From a392a73df79d1ad14eb1c8467f173d8aecc519c4 Mon Sep 17 00:00:00 2001 From: cxxxr Date: Sat, 30 Sep 2023 11:31:51 +0900 Subject: [PATCH] fix for `dc` --- extensions/vi-mode/commands/utils.lisp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/extensions/vi-mode/commands/utils.lisp b/extensions/vi-mode/commands/utils.lisp index 04a2a1efb..eec7cf9ef 100644 --- a/extensions/vi-mode/commands/utils.lisp +++ b/extensions/vi-mode/commands/utils.lisp @@ -163,21 +163,20 @@ (ignore-some-conditions (end-of-buffer) (next-logical-line (1- (or uarg 1)))) (values start (copy-point (current-point)) :line)) - ;; Ignore an invalid operator (like 'dJ') - nil)) + ;; raise error for invalid commands + (error 'editor-abort :message nil))) (otherwise (call-motion command uarg))))))))) (defun visual-region () - (if (visual-p) - (values-list - (append (visual-range) - (list - (cond - ((visual-line-p) :line) - ((visual-block-p) :block) - (t :exclusive))))) - (values nil nil nil))) + (assert (visual-p)) + (values-list + (append (visual-range) + (list + (cond + ((visual-line-p) :line) + ((visual-block-p) :block) + (t :exclusive)))))) (defun operator-region (motion &key move-point with-type) (multiple-value-bind (start end type)