Fix #5155: interactive specs for tmux commands
(interactive "PD") was incorrectly used to pass two interactive arguments to the command, but only the first argument was sent. This corrects that, refactors +tmux/cd to be easier to understand, and updates its docstring to reflect these changes.
This commit is contained in:
parent
bbd15a16ee
commit
09226f905d
1 changed files with 16 additions and 6 deletions
|
@ -52,7 +52,9 @@ but do not execute them."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +tmux/send-region (beg end &optional noreturn)
|
(defun +tmux/send-region (beg end &optional noreturn)
|
||||||
"Send region to tmux."
|
"Send region to tmux."
|
||||||
(interactive "rP")
|
(interactive (list (region-beginning)
|
||||||
|
(region-end)
|
||||||
|
current-prefix-arg))
|
||||||
(+tmux/run (string-trim (buffer-substring-no-properties beg end))
|
(+tmux/run (string-trim (buffer-substring-no-properties beg end))
|
||||||
noreturn))
|
noreturn))
|
||||||
|
|
||||||
|
@ -65,11 +67,19 @@ but do not execute them."
|
||||||
(apply #'+tmux +tmux-last-command))
|
(apply #'+tmux +tmux-last-command))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +tmux/cd (&optional arg directory)
|
(defun +tmux/cd (&optional directory noreturn)
|
||||||
"Change the pwd of the currently active tmux pane to DIRECTORY (defaults to
|
"Change the pwd of the currently active tmux pane to DIRECTORY.
|
||||||
`default-directory', or to `doom-project-root' with the universal argument)."
|
|
||||||
(interactive "PD")
|
DIRECTORY defaults to `default-directory' if omitted, or to `doom-project-root'
|
||||||
(+tmux/run (format "cd %s" (or directory default-directory)) arg))
|
if prefix arg is non-nil.
|
||||||
|
|
||||||
|
If NORETURN is non-nil, send the cd command to tmux, but do not execute the
|
||||||
|
command."
|
||||||
|
(interactive "D")
|
||||||
|
(+tmux/run (format "cd %S" (or directory (if current-prefix-arg
|
||||||
|
(doom-project-root)
|
||||||
|
default-directory)))
|
||||||
|
noreturn))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +tmux/cd-to-here ()
|
(defun +tmux/cd-to-here ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue