Permalink
Browse files

Bug fix : emacs frozen when use line mode in a collapsed org mode

Bug reported by Christopher, when there is collapsed line under org
mode, using ace-jump-line-mode will frozen the emacs. This is because
the special process for line regexp search "^" does not handle the
scenario when searching across the invisible line. So correct it.
  • Loading branch information...
1 parent 0a7d4e6 commit f6fe85fe9157b1df8b8d57d162c437444937c48d @winterTTr committed Nov 4, 2012
Showing with 9 additions and 11 deletions.
  1. +9 −11 ace-jump-mode.el
View
@@ -373,17 +373,15 @@ The returned value is a list of `aj-position' record."
(> (point) end-point)
(eobp))
if (or ace-jump-allow-invisible (not (invisible-p (match-beginning 0))))
- collect (let* ((mb (match-beginning 0))
- (pos (make-aj-position :offset mb
- :visual-area va)))
- ;; when we use "^" to search line mode,
- ;; re-search-backward will not move one
- ;; char after search success, as line
- ;; begin is not a valid visible char.
- ;; We need to help it to move forward.
- (if (string-equal re-query-string "^")
- (goto-char (1+ mb)))
- pos))))))))
+ collect (make-aj-position :offset (match-beginning 0)
+ :visual-area va)
+ ;; when we use "^" to search line mode,
+ ;; re-search-backward will not move one
+ ;; char after search success, as line
+ ;; begin is not a valid visible char.
+ ;; We need to help it to move forward.
+ do (if (string-equal re-query-string "^")
+ (goto-char (1+ (match-beginning 0)))))))))))
(defun ace-jump-tree-breadth-first-construct (total-leaf-node max-child-node)
"Constrct the search tree, each item in the tree is a cons cell.

0 comments on commit f6fe85f

Please sign in to comment.