Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newpage doesn't work as expected #59

Open
c02y opened this issue Jun 19, 2017 · 3 comments
Open

newpage doesn't work as expected #59

c02y opened this issue Jun 19, 2017 · 3 comments

Comments

@c02y
Copy link

c02y commented Jun 19, 2017

when previewing a plantuml file contains newpage keyword, the image preview buffer contains only one image(image generated from the first part of the code), but I use command like

java -jar /path/to/plantuml.jar test.plantuml

it will generate several images according the newpage keyword correctly.

@skuro
Copy link
Owner

skuro commented Jul 7, 2017

newpage is indeed not currently supported. Patches welcome :-)

@ghost ghost mentioned this issue Jul 17, 2018
2 tasks
@skuro
Copy link
Owner

skuro commented May 6, 2019

For future reference: vscode issue #40

@xinyifly
Copy link

I made a trivial hack to get a workaround, here is the elisp code:

(defun plantuml-page-preview (prefix)
  (interactive "p")
  (let ((p (point)))
    (plantuml-page-select)
    (plantuml-preview prefix)
    (deactivate-mark)
    (goto-char p)))
(defun plantuml-page-next ()
  (interactive) (re-search-forward "\\(newpage\\|@enduml\\)" nil 1))
(defun plantuml-page-previous ()
  (interactive) (re-search-backward "\\(newpage\\|@startuml\\)" nil 1))
(defun plantuml-page-select ()
  (when (plantuml-page-previous) (goto-char (match-end 0)))
  (set-mark-command nil)
  (when (plantuml-page-next) (goto-char (match-beginning 0))))

(eval-after-load 'plantuml-mode
  (lambda ()
    (define-key plantuml-mode-map (kbd "C-c C-c") 'plantuml-page-preview)
    (define-key plantuml-mode-map (kbd "C-c C-n") 'plantuml-page-next)
    (define-key plantuml-mode-map (kbd "C-c C-p") 'plantuml-page-previous)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants