mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Apply same menu items to view mode like copy mode.
This commit is contained in:
parent
7c25f22074
commit
1a4e64ba69
6
format.c
6
format.c
@ -1021,7 +1021,8 @@ format_cb_mouse_word(struct format_tree *ft, struct format_entry *fe)
|
||||
return;
|
||||
|
||||
if (!TAILQ_EMPTY(&wp->modes)) {
|
||||
if (TAILQ_FIRST(&wp->modes)->mode == &window_copy_mode)
|
||||
if (TAILQ_FIRST(&wp->modes)->mode == &window_copy_mode ||
|
||||
TAILQ_FIRST(&wp->modes)->mode == &window_view_mode)
|
||||
s = window_copy_get_word(wp, x, y);
|
||||
else
|
||||
s = NULL;
|
||||
@ -1077,7 +1078,8 @@ format_cb_mouse_line(struct format_tree *ft, struct format_entry *fe)
|
||||
return;
|
||||
|
||||
if (!TAILQ_EMPTY(&wp->modes)) {
|
||||
if (TAILQ_FIRST(&wp->modes)->mode == &window_copy_mode)
|
||||
if (TAILQ_FIRST(&wp->modes)->mode == &window_copy_mode ||
|
||||
TAILQ_FIRST(&wp->modes)->mode == &window_view_mode)
|
||||
s = window_copy_get_line(wp, y);
|
||||
else
|
||||
s = NULL;
|
||||
|
@ -46,10 +46,10 @@
|
||||
" 'New After' 'w' {new-window -a}" \
|
||||
" 'New At End' 'W' {new-window}"
|
||||
#define DEFAULT_PANE_MENU \
|
||||
" '#{?#{==:#{pane_mode},copy-mode},Go To Top,}' '<' {send -X history-top}" \
|
||||
" '#{?#{==:#{pane_mode},copy-mode},Go To Bottom,}' '>' {send -X history-bottom}" \
|
||||
" '#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}' '<' {send -X history-top}" \
|
||||
" '#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}' '>' {send -X history-bottom}" \
|
||||
" ''" \
|
||||
" '#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}' 'C-r' {copy-mode -t=; send -Xt= search-backward \"#{q:mouse_word}\"}" \
|
||||
" '#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}' 'C-r' {if -F '#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}' 'copy-mode -t='; send -Xt= search-backward \"#{q:mouse_word}\"}" \
|
||||
" '#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}' 'C-y' {copy-mode -q; send-keys -l -- \"#{q:mouse_word}\"}" \
|
||||
" '#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}' 'c' {copy-mode -q; set-buffer -- \"#{q:mouse_word}\"}" \
|
||||
" '#{?mouse_line,Copy Line,}' 'l' {copy-mode -q; set-buffer -- \"#{q:mouse_line}\"}" \
|
||||
@ -357,7 +357,7 @@ key_bindings_init(void)
|
||||
"bind -n MouseDown3Status display-menu -t= -xW -yS -T '#[align=centre]#{window_index}:#{window_name}' " DEFAULT_WINDOW_MENU,
|
||||
|
||||
/* Mouse button 3 down on pane. */
|
||||
"bind -n MouseDown3Pane if -Ft= '#{||:#{mouse_any_flag},#{&&:#{pane_in_mode},#{!=:#{pane_mode},copy-mode}}}' { select-pane -t=; send -M } { display-menu -t= -xM -yM -T '#[align=centre]#{pane_index} (#{pane_id})' " DEFAULT_PANE_MENU " }",
|
||||
"bind -n MouseDown3Pane if -Ft= '#{||:#{mouse_any_flag},#{&&:#{pane_in_mode},#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}}}' { select-pane -t=; send -M } { display-menu -t= -xM -yM -T '#[align=centre]#{pane_index} (#{pane_id})' " DEFAULT_PANE_MENU " }",
|
||||
"bind -n M-MouseDown3Pane display-menu -t= -xM -yM -T '#[align=centre]#{pane_index} (#{pane_id})' " DEFAULT_PANE_MENU,
|
||||
|
||||
/* Copy mode (emacs) keys. */
|
||||
|
Loading…
Reference in New Issue
Block a user