Skip to content

Commit

Permalink
Fix #63
Browse files Browse the repository at this point in the history
Also fixed regex for jumping around skeleton headings and speed up
isearch by narrowing to the current page when changing pages
  • Loading branch information
fuxialexander committed Jan 18, 2021
1 parent 812bbff commit a5b61bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
14 changes: 8 additions & 6 deletions org-noter-pdftools.el
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,19 @@ To use this, `org-noter-pdftools-use-org-id' has to be t."
"Interface for parse PROPERTY link."
(when (org-noter-pdftools--location-link-p property)
(setq property (string-trim property "\\[\\[" "\\]\\]"))
(let ((link-regexp (concat "\\(.*\\)::\\([0-9]*\\)\\+\\+\\([[0-9]\\.*[0-9]*\\)\\(;;\\|" (regexp-quote org-pdftools-search-string-separator) "\\)?\\(.*\\)?")))
(let ((link-regexp (concat "\\(.*\\)::\\([0-9]*\\)\\(\\+\\+\\)?\\([[0-9]\\.*[0-9]*\\)?\\(;;\\|"
(regexp-quote org-pdftools-search-string-separator)
"\\)?\\(.*\\)?")))
(string-match link-regexp property)
(let ((path (match-string 1 property))
(page (match-string 2 property))
(height (match-string 3 property))
(height (match-string 4 property))
annot-id search-string)
(condition-case nil
(cond ((string-equal (match-string 4 property) ";;")
(setq annot-id (match-string 5 property)))
((string-equal (match-string 4 property) org-pdftools-search-string-separator)
(setq search-string (replace-regexp-in-string "%20" " " (match-string 5 property)))))
(cond ((string-equal (match-string 5 property) ";;")
(setq annot-id (match-string 6 property)))
((string-equal (match-string 5 property) org-pdftools-search-string-separator)
(setq search-string (replace-regexp-in-string "%20" " " (match-string 6 property)))))
(error nil))
(make-org-noter-pdftools--location
:path path
Expand Down
9 changes: 6 additions & 3 deletions org-pdftools.el
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,12 @@ Can be one of highlight/underline/strikeout/squiggly."
(with-selected-window
(org-noter--get-doc-window)
(isearch-mode t)
(isearch-yank-string search-string)))
(let (pdf-isearch-narrow-to-page t)
(isearch-yank-string search-string))
))
(isearch-mode t)
(isearch-yank-string search-string)))))
(let (pdf-isearch-narrow-to-page t)
(isearch-yank-string search-string))))))
((string-match
"\\(.*\\)@@\\(.*\\)"
link)
Expand All @@ -231,7 +234,7 @@ Can be one of highlight/underline/strikeout/squiggly."
(pdf-annot-get-id
(funcall
org-pdftools-markup-pointer-function
(pdf-view-active-region t)
(pdf-view-active-region)
org-pdftools-markup-pointer-color
`((opacity . ,org-pdftools-markup-pointer-opacity))))
(if (and (not (bound-and-true-p org-noter--session))
Expand Down

0 comments on commit a5b61bc

Please sign in to comment.