Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Adjust cursor position after all commands in NORMAL mode.
  • Loading branch information
fukamachi committed Aug 29, 2023
commit 09cf1381a12767b61ce47b94274410ce39892995
4 changes: 2 additions & 2 deletions extensions/vi-mode/tests/motion.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
(cmd "E")
(ok (buf= #?"abc-def (ghi jkl) # \n\t [m]"))
(cmd "E")
(ok (buf= #?"abc-def (ghi jkl) # \n\t m[]"))
(ok (buf= #?"abc-def (ghi jkl) # \n\t [m]"))
(cmd "gg")
(cmd "3E")
(ok (buf= #?"abc-def (ghi jkl[)] # \n\t m")))
Expand Down Expand Up @@ -203,7 +203,7 @@
(cmd "W")
(ok (buf= #?"abc-def (ghi jkl) # \n\t [m]"))
(cmd "W")
(ok (buf= #?"abc-def (ghi jkl) # \n\t m[]"))
(ok (buf= #?"abc-def (ghi jkl) # \n\t [m]"))
(cmd "gg")
(cmd "3W")
(ok (buf= #?"abc-def (ghi jkl) [#] \n\t m")))
Expand Down
5 changes: 4 additions & 1 deletion extensions/vi-mode/vi-mode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
(:import-from :lem-vi-mode/commands
:vi-open-below
:vi-open-above)
(:import-from :lem-vi-mode/commands/utils
:fall-within-line)
(:import-from :lem-vi-mode/states
:normal
:insert
Expand Down Expand Up @@ -35,7 +37,8 @@
(let ((command (this-command)))
(when (and (typep command 'vi-command)
(eq (vi-command-repeat command) t))
(setf *last-repeat-keys* (vi-this-command-keys))))))
(setf *last-repeat-keys* (vi-this-command-keys)))))
(fall-within-line (current-point)))

(defmethod post-command-hook ((state insert))
(let ((command (this-command)))
Expand Down