From 56d11b494b54862a9b55ca1efcaa35f26c56b3ff Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Wed, 4 Dec 2024 08:40:01 -0600 Subject: [PATCH] defaults: disable 'number', 'relativenumber', and 'signcolumn' in terminal buffers (#31443) --- runtime/doc/vim_diff.txt | 3 +++ runtime/lua/vim/_defaults.lua | 3 +++ test/functional/terminal/cursor_spec.lua | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 8e19df0160..8d2d672ce1 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -186,6 +186,9 @@ nvim_terminal: - 'textwidth' set to 0 - 'nowrap' - 'nolist' + - 'nonumber' + - 'norelativenumber' + - 'signcolumn' set to "no" - 'winhighlight' uses |hl-StatusLineTerm| and |hl-StatusLineTermNC| in place of |hl-StatusLine| and |hl-StatusLineNC| diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua index 6583cf48b3..ef83a3ccc3 100644 --- a/runtime/lua/vim/_defaults.lua +++ b/runtime/lua/vim/_defaults.lua @@ -492,6 +492,9 @@ do vim.bo.textwidth = 0 vim.wo[0][0].wrap = false vim.wo[0][0].list = false + vim.wo[0][0].number = false + vim.wo[0][0].relativenumber = false + vim.wo[0][0].signcolumn = 'no' -- This is gross. Proper list options support when? local winhl = vim.o.winhighlight diff --git a/test/functional/terminal/cursor_spec.lua b/test/functional/terminal/cursor_spec.lua index f223cdd417..4d25fe62ad 100644 --- a/test/functional/terminal/cursor_spec.lua +++ b/test/functional/terminal/cursor_spec.lua @@ -511,7 +511,7 @@ describe('buffer cursor position is correct in terminal with number column', fun before_each(function() clear() - command('set number') + command('au TermOpen * set number') end) describe('in a line with no multibyte chars or trailing spaces,', function()