Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix 'd%' to work regardless of whether the direction is forward or ba…
…ckward.
  • Loading branch information
fukamachi committed Aug 17, 2023
commit 2f277de5c130fb781dde91dfebd7d4e1afa0de9b
8 changes: 4 additions & 4 deletions extensions/vi-mode/commands.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,12 @@
(redo n)
(fall-within-line (current-point)))

(defun vi-forward-matching-paren (window point &optional (offset *cursor-offset*))
(declare (ignore window offset))
(defun vi-forward-matching-paren (window point &optional (offset -1))
(declare (ignore window))
(with-point ((point point))
(when (syntax-open-paren-char-p (character-at point))
(when (scan-lists point 1 0 t)
(character-offset point *cursor-offset*)))))
(character-offset point offset)))))

(defun vi-backward-matching-paren (window point &optional (offset -1))
(declare (ignore window offset))
Expand All @@ -463,7 +463,7 @@
(:type :inclusive
:jump t)
(alexandria:when-let ((p (or (vi-backward-matching-paren (current-window) (current-point))
(vi-forward-matching-paren (current-window) (current-point) *cursor-offset*))))
(vi-forward-matching-paren (current-window) (current-point)))))
(move-point (current-point) p)))

(let ((old-forward-matching-paren)
Expand Down