Skip to content

Commit ba1e832

Browse files
authored
Merge pull request #1018 from fukamachi/vi-adjust-cursor-position
Adjust cursor position after all commands in NORMAL mode
2 parents 10c7741 + 09cf138 commit ba1e832

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

extensions/vi-mode/tests/motion.lisp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
(cmd "E")
8080
(ok (buf= #?"abc-def (ghi jkl) # \n\t [m]"))
8181
(cmd "E")
82-
(ok (buf= #?"abc-def (ghi jkl) # \n\t m[]"))
82+
(ok (buf= #?"abc-def (ghi jkl) # \n\t [m]"))
8383
(cmd "gg")
8484
(cmd "3E")
8585
(ok (buf= #?"abc-def (ghi jkl[)] # \n\t m")))
@@ -203,7 +203,7 @@
203203
(cmd "W")
204204
(ok (buf= #?"abc-def (ghi jkl) # \n\t [m]"))
205205
(cmd "W")
206-
(ok (buf= #?"abc-def (ghi jkl) # \n\t m[]"))
206+
(ok (buf= #?"abc-def (ghi jkl) # \n\t [m]"))
207207
(cmd "gg")
208208
(cmd "3W")
209209
(ok (buf= #?"abc-def (ghi jkl) [#] \n\t m")))

extensions/vi-mode/vi-mode.lisp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
(:import-from :lem-vi-mode/commands
99
:vi-open-below
1010
:vi-open-above)
11+
(:import-from :lem-vi-mode/commands/utils
12+
:fall-within-line)
1113
(:import-from :lem-vi-mode/states
1214
:normal
1315
:insert
@@ -35,7 +37,8 @@
3537
(let ((command (this-command)))
3638
(when (and (typep command 'vi-command)
3739
(eq (vi-command-repeat command) t))
38-
(setf *last-repeat-keys* (vi-this-command-keys))))))
40+
(setf *last-repeat-keys* (vi-this-command-keys)))))
41+
(fall-within-line (current-point)))
3942

4043
(defmethod post-command-hook ((state insert))
4144
(let ((command (this-command)))

0 commit comments

Comments
 (0)