From 023f67cad8d6fb3e435d0bcc815cbaec8b1692d5 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 27 May 2017 15:08:38 +0200 Subject: [PATCH] terminal: Do not change 'number', 'relativenumber' (#6796) Showing the 'number' column in terminal buffers is a bit silly because of 'scrollback'. But it's mostly harmless and technically works as expected. The least surprising thing is to leave the user's settings alone. Since there are tradeoffs in both cases, we choose inertia. We still disable 'relativenumber' in *terminal-mode* (as opposed to normal-mode) because it is totally broken: the Nvim cursor (not terminal cursor) is always on the last line. --- runtime/doc/nvim_terminal_emulator.txt | 5 ++--- src/nvim/terminal.c | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index cfe011250e..801ff75647 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -93,12 +93,11 @@ Terminal sets local defaults for some options, which may differ from your global configuration. - 'list' is disabled -- 'number' is disabled -- 'relativenumber' is disabled (cannot be changed in |Terminal-mode|) - 'wrap' is disabled +- 'relativenumber' is disabled in |Terminal-mode| (and cannot be enabled) You can change the defaults with a TermOpen autocommand: > - au TermOpen * setlocal number + au TermOpen * setlocal list Terminal colors can be customized with these variables: diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index b8b7085c5e..5b250ebf54 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -237,8 +237,6 @@ Terminal *terminal_open(TerminalOptions opts) curbuf->b_p_scbk = p_scbk; // 'scrollback' curbuf->b_p_tw = 0; // 'textwidth' set_option_value("wrap", false, NULL, OPT_LOCAL); - set_option_value("number", false, NULL, OPT_LOCAL); - set_option_value("relativenumber", false, NULL, OPT_LOCAL); set_option_value("list", false, NULL, OPT_LOCAL); buf_set_term_title(curbuf, (char *)curbuf->b_ffname); RESET_BINDING(curwin);