diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2025-03-19 04:17:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-19 04:17:00 -0700 |
commit | 74fcc9452cd99680a9f4aad255e90204966f74c3 (patch) | |
tree | 80d2dd3af6b6734c90d85e3a8323601f6b703576 | |
parent | d6653e1cc957ef39b397e073230da87ee9a5411d (diff) | |
download | rneovim-74fcc9452cd99680a9f4aad255e90204966f74c3.tar.gz rneovim-74fcc9452cd99680a9f4aad255e90204966f74c3.tar.bz2 rneovim-74fcc9452cd99680a9f4aad255e90204966f74c3.zip |
fix(runtime): gO always says "Help TOC" #32971
Problem:
gO always says "Help TOC".
Solution:
Use a generic title instead.
-rw-r--r-- | runtime/ftplugin/checkhealth.lua | 2 | ||||
-rw-r--r-- | runtime/ftplugin/help.lua | 2 | ||||
-rw-r--r-- | runtime/ftplugin/markdown.lua | 2 | ||||
-rw-r--r-- | runtime/lua/man.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/_headings.lua | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/runtime/ftplugin/checkhealth.lua b/runtime/ftplugin/checkhealth.lua index d0f8cec074..1ceee7cfc3 100644 --- a/runtime/ftplugin/checkhealth.lua +++ b/runtime/ftplugin/checkhealth.lua @@ -1,6 +1,6 @@ vim.keymap.set('n', 'gO', function() require('vim.treesitter._headings').show_toc() -end, { buffer = 0, silent = true, desc = 'Show table of contents for current buffer' }) +end, { buffer = 0, silent = true, desc = 'Show an Outline of the current buffer' }) vim.keymap.set('n', ']]', function() require('vim.treesitter._headings').jump({ count = 1, level = 1 }) diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index 1833e70ff9..14255fa0fc 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -57,7 +57,7 @@ end vim.keymap.set('n', 'gO', function() require('vim.treesitter._headings').show_toc() -end, { buffer = 0, silent = true, desc = 'Show table of contents for current buffer' }) +end, { buffer = 0, silent = true, desc = 'Show an Outline of the current buffer' }) vim.keymap.set('n', ']]', function() require('vim.treesitter._headings').jump({ count = 1 }) diff --git a/runtime/ftplugin/markdown.lua b/runtime/ftplugin/markdown.lua index d9958706c8..33b047c237 100644 --- a/runtime/ftplugin/markdown.lua +++ b/runtime/ftplugin/markdown.lua @@ -1,6 +1,6 @@ vim.keymap.set('n', 'gO', function() require('vim.treesitter._headings').show_toc() -end, { buffer = 0, silent = true, desc = 'Show table of contents for current buffer' }) +end, { buffer = 0, silent = true, desc = 'Show an Outline of the current buffer' }) vim.keymap.set('n', ']]', function() require('vim.treesitter._headings').jump({ count = 1 }) diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index 96cfdf523d..a7596bb1c3 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -800,7 +800,7 @@ function M.show_toc() end fn.setloclist(0, toc, ' ') - fn.setloclist(0, {}, 'a', { title = 'Man TOC' }) + fn.setloclist(0, {}, 'a', { title = 'Table of contents' }) vim.cmd.lopen() vim.w.qf_toc = bufname end diff --git a/runtime/lua/vim/treesitter/_headings.lua b/runtime/lua/vim/treesitter/_headings.lua index 4e8833c93a..885d014a89 100644 --- a/runtime/lua/vim/treesitter/_headings.lua +++ b/runtime/lua/vim/treesitter/_headings.lua @@ -87,7 +87,7 @@ local get_headings = vim.func._memoize(hash_tick, function(bufnr) return headings end) ---- Show a table of contents for the help buffer in a loclist +--- Shows an Outline (table of contents) of the current buffer, in the loclist. function M.show_toc() local bufnr = api.nvim_get_current_buf() local headings = get_headings(bufnr) @@ -104,7 +104,7 @@ function M.show_toc() end end vim.fn.setloclist(0, headings, ' ') - vim.fn.setloclist(0, {}, 'a', { title = 'Help TOC' }) + vim.fn.setloclist(0, {}, 'a', { title = 'Table of contents' }) vim.cmd.lopen() end |