Skip to content

Commit

Permalink
Merge pull request #1231 from mychris/patch/ex-wqa-write-all
Browse files Browse the repository at this point in the history
Fixes vi-mode ex command :wqall should write all buffers.
  • Loading branch information
cxxxr authored Jan 5, 2024
2 parents d10b89a + 43023b6 commit 67d9877
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions extensions/vi-mode/ex-command.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
filename)))
(otherwise (syntax-error))))

(defun ex-write-all (force)
(lem:save-some-buffers force))

(defun ex-write-quit (range filename force touch)
(ex-write range filename touch)
(lem-vi-mode/commands:vi-quit force))
Expand Down Expand Up @@ -72,12 +75,14 @@
(declare (ignore range argument))
(lem:exit-lem nil))

(define-ex-command "^wqa$" (range filename)
(ex-write range filename nil)
(define-ex-command "^(?:wqa|xa)(?:ll)?$" (range argument)
(declare (ignore range argument))
(ex-write-all nil)
(lem:exit-lem t))

(define-ex-command "^wqa!$" (range filename)
(ex-write range filename nil)
(define-ex-command "^(?:wqa|xa)(?:ll)?!$" (range argument)
(declare (ignore range argument))
(ex-write-all t)
(lem:exit-lem nil))

(define-ex-command "^(x|xit)$" (range filename)
Expand Down

0 comments on commit 67d9877

Please sign in to comment.