Change line-numbers menu to On/Off.

This commit is contained in:
Michael Grant
2026-07-29 23:35:11 +01:00
parent 0a7788b66f
commit 0330d8ac57
3 changed files with 4 additions and 3 deletions

View File

@@ -49,7 +49,7 @@
" '#{?#{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}" \
" ''" \
" '#{?#{==:#{pane_mode},copy-mode},#{?copy_line_numbers,Hide Line Numbers,Show Line Numbers},}' 'L' {send -X line-numbers-toggle}" \
" '#{?#{==:#{pane_mode},copy-mode},#{?copy_line_numbers,Line Numbers Off,Line Numbers On},}' 'L' {send -X line-numbers-toggle}" \
" '#{?#{==:#{pane_mode},copy-mode},#{?copy_fold_view,Fold View Off,Fold View On},}' 'O' {send -X fold-view-toggle}" \
" '#{?#{==:#{pane_mode},copy-mode},#{?refresh_active,Refresh Off,Refresh On},}' 'r' {send -X refresh-toggle}" \
" ''" \

View File

@@ -75,6 +75,7 @@ sleep 1
capture
check_grep "out2"
check_no_grep "!+ p\$ two"
check_grep " 3 p\$ two"
$TMUX2 send -X fold-view-toggle || exit 1
[ "$($TMUX2 display -p '#{copy_fold_view}')" = 1 ] || exit 1
sleep 1

View File

@@ -330,7 +330,7 @@ struct window_copy_mode_data {
int rectflag; /* in rectangle copy mode? */
int scroll_exit; /* exit on scroll to end? */
int hide_position; /* hide position marker */
int line_numbers; /* 0 off, 1 from option, 2 default */
int line_numbers; /* 0 off, 1 from option, 2 absolute */
int output_gutter;
int output_controls;
int top_output;
@@ -5971,7 +5971,7 @@ window_copy_line_number_mode(struct window_mode_entry *wme)
return (WINDOW_COPY_LINE_NUMBERS_OFF);
mode = options_get_number(oo, "copy-mode-line-numbers");
if (data->line_numbers == 2 && mode == WINDOW_COPY_LINE_NUMBERS_OFF)
return (WINDOW_COPY_LINE_NUMBERS_DEFAULT);
return (WINDOW_COPY_LINE_NUMBERS_ABSOLUTE);
return (mode);
}