From 4bbd65bc17007919807a81d85a0b3c187190477d Mon Sep 17 00:00:00 2001 From: gos-k Date: Mon, 21 Oct 2024 12:50:47 +0900 Subject: [PATCH] Add *edit-buffer-directory* to vi-mode --- extensions/vi-mode/ex-command.lisp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extensions/vi-mode/ex-command.lisp b/extensions/vi-mode/ex-command.lisp index 350138a98..6c68a6210 100644 --- a/extensions/vi-mode/ex-command.lisp +++ b/extensions/vi-mode/ex-command.lisp @@ -10,15 +10,20 @@ :execute-set-command) (:import-from :lem-vi-mode/utils :change-directory* - :expand-filename-modifiers)) + :expand-filename-modifiers) + (:export :*edit-buffer-directory*)) (in-package :lem-vi-mode/ex-command) +(defvar *edit-buffer-directory* nil) + (defun ex-edit (filename force) (if (string= filename "") (lem:revert-buffer force) (with-jumplist (lem:find-file (merge-pathnames (expand-filename-modifiers filename) - (uiop:getcwd)))))) + (if *edit-buffer-directory* + (lem:buffer-directory) + (uiop:getcwd))))))) (defun ex-write (range filename touch) (case (length range)