From 98ba65b8be8cb2dde839502357e70916c4a3e37a Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:32:08 -0500 Subject: [PATCH] fix: replace NVIM with Nvim in default titlestring (#30348) --- runtime/doc/options.txt | 4 ++-- runtime/lua/vim/_meta/options.lua | 4 ++-- src/nvim/buffer.c | 4 ++-- src/nvim/options.lua | 6 +++--- test/functional/ui/title_spec.lua | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 3693f46790..e7190e718d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -6713,7 +6713,7 @@ A jump table for the options with a short description can be found at |Q_op|. global When on, the title of the window will be set to the value of 'titlestring' (if it is not empty), or to: - filename [+=-] (path) - NVIM + filename [+=-] (path) - Nvim Where: filename the name of the file being edited - indicates the file cannot be modified, 'ma' off @@ -6721,7 +6721,7 @@ A jump table for the options with a short description can be found at |Q_op|. = indicates the file is read-only =+ indicates the file is read-only and modified (path) is the path of the file being edited - - NVIM the server name |v:servername| or "NVIM" + - Nvim the server name |v:servername| or "Nvim" *'titlelen'* 'titlelen' number (default 85) diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 787e661402..7456be0ae0 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -7255,7 +7255,7 @@ vim.go.tm = vim.go.timeoutlen --- When on, the title of the window will be set to the value of --- 'titlestring' (if it is not empty), or to: ---- filename [+=-] (path) - NVIM +--- filename [+=-] (path) - Nvim --- Where: --- filename the name of the file being edited --- - indicates the file cannot be modified, 'ma' off @@ -7263,7 +7263,7 @@ vim.go.tm = vim.go.timeoutlen --- = indicates the file is read-only --- =+ indicates the file is read-only and modified --- (path) is the path of the file being edited ---- - NVIM the server name `v:servername` or "NVIM" +--- - Nvim the server name `v:servername` or "Nvim" --- --- @type boolean vim.o.title = false diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f986f558a9..e47db44f68 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3338,7 +3338,7 @@ void maketitle(void) #define SPACE_FOR_FNAME (sizeof(buf) - 100) #define SPACE_FOR_DIR (sizeof(buf) - 20) -#define SPACE_FOR_ARGNR (sizeof(buf) - 10) // At least room for " - NVIM". +#define SPACE_FOR_ARGNR (sizeof(buf) - 10) // At least room for " - Nvim". char *buf_p = buf; if (curbuf->b_fname == NULL) { const size_t size = xstrlcpy(buf_p, _("[No Name]"), @@ -3412,7 +3412,7 @@ void maketitle(void) append_arg_number(curwin, buf_p, (int)(SPACE_FOR_ARGNR - (size_t)(buf_p - buf))); - xstrlcat(buf_p, " - NVIM", (sizeof(buf) - (size_t)(buf_p - buf))); + xstrlcat(buf_p, " - Nvim", (sizeof(buf) - (size_t)(buf_p - buf))); if (maxlen > 0) { // Make it shorter by removing a bit in the middle. diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 71b0d26b49..8943faad7d 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -9047,7 +9047,7 @@ return { desc = [=[ When on, the title of the window will be set to the value of 'titlestring' (if it is not empty), or to: - filename [+=-] (path) - NVIM + filename [+=-] (path) - Nvim Where: filename the name of the file being edited - indicates the file cannot be modified, 'ma' off @@ -9055,11 +9055,11 @@ return { = indicates the file is read-only =+ indicates the file is read-only and modified (path) is the path of the file being edited - - NVIM the server name |v:servername| or "NVIM" + - Nvim the server name |v:servername| or "Nvim" ]=], full_name = 'title', scope = { 'global' }, - short_desc = N_('Vim set the title of the window'), + short_desc = N_('set the title of the window'), type = 'boolean', varname = 'p_title', }, diff --git a/test/functional/ui/title_spec.lua b/test/functional/ui/title_spec.lua index fddda2c07a..3189232957 100644 --- a/test/functional/ui/title_spec.lua +++ b/test/functional/ui/title_spec.lua @@ -22,7 +22,7 @@ describe('title', function() end) it('has correct default title with unnamed file', function() - local expected = '[No Name] - NVIM' + local expected = '[No Name] - Nvim' command('set title') screen:expect(function() eq(expected, screen.title) @@ -30,7 +30,7 @@ describe('title', function() end) it('has correct default title with named file', function() - local expected = (is_os('win') and 'myfile (C:\\mydir) - NVIM' or 'myfile (/mydir) - NVIM') + local expected = (is_os('win') and 'myfile (C:\\mydir) - Nvim' or 'myfile (/mydir) - Nvim') command('set title') command(is_os('win') and 'file C:\\mydir\\myfile' or 'file /mydir/myfile') screen:expect(function() @@ -41,7 +41,7 @@ describe('title', function() describe('is not changed by', function() local file1 = is_os('win') and 'C:\\mydir\\myfile1' or '/mydir/myfile1' local file2 = is_os('win') and 'C:\\mydir\\myfile2' or '/mydir/myfile2' - local expected = (is_os('win') and 'myfile1 (C:\\mydir) - NVIM' or 'myfile1 (/mydir) - NVIM') + local expected = (is_os('win') and 'myfile1 (C:\\mydir) - Nvim' or 'myfile1 (/mydir) - Nvim') local buf2 before_each(function()