aboutsummaryrefslogtreecommitdiff
path: root/evil-commands.el
diff options
context:
space:
mode:
authorFrank Fischer <frank.fischer@mathematik.tu-chemnitz.de>2013-01-27 15:48:30 +0100
committerFrank Fischer <frank.fischer@mathematik.tu-chemnitz.de>2013-01-27 15:48:30 +0100
commit6abee315179e24d3c534e77655fdba9c11f93e24 (patch)
tree41bbfa9ec4ddbe274bd852a543f38b37d0fc847f /evil-commands.el
parent3d18ce9a226046e9b9281dcfa3455a959ce8752e (diff)
Make `evil-jump-item` work with any block comments.
This change uses Emacs syntax capabilities to detect beginning and ends of block comments. So this movement is no longer restricted to /* */ pairs in C-like languages but works with any proper paired comment delimiters.
Diffstat (limited to 'evil-commands.el')
-rw-r--r--evil-commands.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/evil-commands.el b/evil-commands.el
index d5299ca..7998b49 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -449,12 +449,14 @@ and jump to the corresponding one."
(/ (* count size) 100))))))
(back-to-indentation)
(setq evil-this-type 'line))
- ((and (memq major-mode '(c-mode c++-mode))
- (or (and (char-equal (preceding-char) ?/)
- (char-equal (following-char) ?*))
- (and (char-equal (following-char) ?/)
- (char-equal (char-after (+ 1 (point))) ?*))))
- (and (search-forward "*/") (backward-char)))
+ ((and (evil-looking-at-start-comment t)
+ (let ((pnt (point)))
+ (forward-comment 1)
+ (or (not (bolp))
+ (prog1 nil (goto-char pnt)))))
+ (backward-char))
+ ((and (not (eolp)) (evil-looking-at-end-comment t))
+ (forward-comment -1))
((and (memq major-mode '(c-mode c++-mode))
(or (and (char-equal (preceding-char) ?*)
(char-equal (following-char) ?/))