tmux: Bind MouseDragEnd1StatusDefault w/o run-shell
The special token `$` indicates the highest-numbered window. Also switch to using before `^` when moving to the front for consistency.
This commit is contained in:
@@ -169,14 +169,15 @@ bind -r P swap-window -d -t :-1
|
|||||||
# Reorder windows by dragging them in the status line.
|
# Reorder windows by dragging them in the status line.
|
||||||
bind -n MouseDrag1Status swap-window -d -t=
|
bind -n MouseDrag1Status swap-window -d -t=
|
||||||
|
|
||||||
|
# Move a window to the first or very last position
|
||||||
# TODO: do nothing on drags that don't start on a window name
|
# TODO: do nothing on drags that don't start on a window name
|
||||||
# NOTE: mouse_{x,y} were not set in status line before 3.3
|
# NOTE: mouse_{x,y} were not set in status line before 3.3
|
||||||
if -F "#{>=:#{version},3.3}" {
|
if -F "#{>=:#{version},3.3}" {
|
||||||
bind -n MouseDragEnd1StatusDefault {
|
bind -n MouseDragEnd1StatusDefault {
|
||||||
if -F "#{e|>|f|0:#{mouse_x},#{e|/|f:#{window_width},2}}" {
|
if -F "#{e|>|f|0:#{mouse_x},#{e|/|f:#{window_width},2}}" {
|
||||||
run-shell "tmux move-window -at #{last_window_index}"
|
move-window -at :$
|
||||||
} {
|
} {
|
||||||
move-window -t0
|
move-window -bt :^
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user