From 891b235df039af71246f3c2e81a44d5cd9b9630f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 16 Jun 2024 06:08:36 +0800 Subject: [PATCH] docs: document 'list' behavior when 'listchars' excludes "tab" (#29360) (cherry picked from commit 7e65f3757bdbe41bbf022b05b6869ad6e7febe0d) --- runtime/doc/options.txt | 3 +++ runtime/lua/vim/_meta/options.lua | 3 +++ src/nvim/options.lua | 3 +++ 3 files changed, 9 insertions(+) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index edda46e197..58cc8cc709 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3834,6 +3834,9 @@ A jump table for the options with a short description can be found at |Q_op|. between tabs and spaces and for trailing blanks. Further changed by the 'listchars' option. + When 'listchars' does not contain "tab" field, tabs are shown as "^I" + or "<09>", like how unprintable characters are displayed. + The cursor is displayed at the start of the space a Tab character occupies, not at the end as usual in Normal mode. To get this cursor position while displaying Tabs with spaces, use: >vim diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 428b7c4d4f..3acd7c8863 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -3820,6 +3820,9 @@ vim.go.lw = vim.go.lispwords --- between tabs and spaces and for trailing blanks. Further changed by --- the 'listchars' option. --- +--- When 'listchars' does not contain "tab" field, tabs are shown as "^I" +--- or "<09>", like how unprintable characters are displayed. +--- --- The cursor is displayed at the start of the space a Tab character --- occupies, not at the end as usual in Normal mode. To get this cursor --- position while displaying Tabs with spaces, use: diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 452cc6876b..9505864a33 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -4868,6 +4868,9 @@ return { between tabs and spaces and for trailing blanks. Further changed by the 'listchars' option. + When 'listchars' does not contain "tab" field, tabs are shown as "^I" + or "<09>", like how unprintable characters are displayed. + The cursor is displayed at the start of the space a Tab character occupies, not at the end as usual in Normal mode. To get this cursor position while displaying Tabs with spaces, use: >vim