From 0330d8ac5767d030125312d9e5bcbc968e3a448c Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Wed, 29 Jul 2026 23:35:11 +0100 Subject: [PATCH] Change line-numbers menu to On/Off. --- key-bindings.c | 2 +- regress/copy-mode-exit-status.sh | 1 + window-copy.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/key-bindings.c b/key-bindings.c index 401dac819..11e64a248 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -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}" \ " ''" \ diff --git a/regress/copy-mode-exit-status.sh b/regress/copy-mode-exit-status.sh index 1ff00fecf..76bb0ec6c 100644 --- a/regress/copy-mode-exit-status.sh +++ b/regress/copy-mode-exit-status.sh @@ -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 diff --git a/window-copy.c b/window-copy.c index ba79c03bb..7eb85cc28 100644 --- a/window-copy.c +++ b/window-copy.c @@ -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); }