diff --git a/extensions/vi-mode/commands.lisp b/extensions/vi-mode/commands.lisp index b6d86e8f7..616144186 100644 --- a/extensions/vi-mode/commands.lisp +++ b/extensions/vi-mode/commands.lisp @@ -123,6 +123,7 @@ :vi-append-line :vi-open-below :vi-open-above + :vi-jumps :vi-jump-back :vi-jump-next :vi-a-word @@ -402,10 +403,10 @@ Move the cursor to the first non-blank character of the line." (max 0 (min (1- (length (line-string (current-point)))) pos)))) (:block - (move-to-line (current-point) (min (line-number-at-point start) - (line-number-at-point end))) - (move-to-column (current-point) (min column-start - column-end)))) + (move-to-line (current-point) (min (line-number-at-point start) + (line-number-at-point end))) + (move-to-column (current-point) (min column-start + column-end)))) ;; After 'dw' or 'dW', move to the first non-blank char (when (and (this-motion-command) (member (command-name (this-motion-command)) @@ -506,10 +507,10 @@ Move the cursor to the first non-blank character of the line." (yank-region start end :type type) (case type (:block - (move-to-line (current-point) (min (line-number-at-point start) - (line-number-at-point end))) - (move-to-column (current-point) (min (point-column start) - (point-column end)))) + (move-to-line (current-point) (min (line-number-at-point start) + (line-number-at-point end))) + (move-to-column (current-point) (min (point-column start) + (point-column end)))) (:line (move-to-column start (point-charpos (current-point))) (move-point (current-point) start)) @@ -797,9 +798,9 @@ on the same line or at eol if there are none." (move-point point p))) (lambda (point regex &optional limit-point) (lem/isearch::search-forward-regexp - point - (ignore-errors (ppcre:create-scanner regex :case-insensitive-mode case-insensitive)) - limit-point)) + point + (ignore-errors (ppcre:create-scanner regex :case-insensitive-mode case-insensitive)) + limit-point)) (lambda (point regex &optional limit-point) (lem/isearch::search-backward-regexp point @@ -924,7 +925,7 @@ on the same line or at eol if there are none." (string c) limit) unless result - do (return nil) + do (return nil) finally (return t)) (character-offset p offset) (move-point (current-point) p))))) @@ -1015,6 +1016,11 @@ on the same line or at eol if there are none." (line-start p)))))) (move-to-column (current-point) column t))) +(define-command vi-jumps () () + (line-end (current-point)) + (lem:message-buffer (with-output-to-string (s) + (lem-vi-mode/jumplist::print-jumplist (current-jumplist) s)))) + (define-command vi-jump-back (&optional (n 1)) (:universal) (dotimes (i n) (jump-back))) diff --git a/extensions/vi-mode/ex-command.lisp b/extensions/vi-mode/ex-command.lisp index 591bed79a..a93deb6cb 100644 --- a/extensions/vi-mode/ex-command.lisp +++ b/extensions/vi-mode/ex-command.lisp @@ -67,12 +67,12 @@ (ex-write range filename t))) (define-ex-command "^bn$" (range argument) - (declare (ignore range argument)) - (lem:next-buffer)) + (declare (ignore range argument)) + (lem:next-buffer)) (define-ex-command "^bp$" (range argument) - (declare (ignore range argument)) - (lem:previous-buffer)) + (declare (ignore range argument)) + (lem:previous-buffer)) (define-ex-command "^wq$" (range filename) (ex-write-quit range filename nil t)) @@ -190,8 +190,8 @@ (declare (ignore range)) (lem:pipe-command (format nil "~A ~A" - (subseq lem-vi-mode/ex-core:*command* 1) - command))) + (subseq lem-vi-mode/ex-core:*command* 1) + command))) (define-ex-command "^(buffers|ls|files)$" (range argument) (declare (ignore range argument)) @@ -259,3 +259,7 @@ (define-ex-command "^pwd?$" (range argument) (declare (ignore range argument)) (lem:current-directory)) + +(define-ex-command "^jumps?$" (range argument) + (declare (ignore range argument)) + (lem-vi-mode/commands:vi-jumps))