aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2021-04-05 00:59:51 +0200
committerStephan Seitz <stephan.lauf@yahoo.de>2021-04-05 15:41:00 +0200
commit8840641accf6d9bbaa07ab21f722ff4587040c09 (patch)
tree373455575fb7622255e1e3cc4f14774ced78520f /lua
parentTSModuleInfo: sort mods and languages (diff)
downloadnvim-treesitter-8840641accf6d9bbaa07ab21f722ff4587040c09.tar
nvim-treesitter-8840641accf6d9bbaa07ab21f722ff4587040c09.tar.gz
nvim-treesitter-8840641accf6d9bbaa07ab21f722ff4587040c09.tar.bz2
nvim-treesitter-8840641accf6d9bbaa07ab21f722ff4587040c09.tar.lz
nvim-treesitter-8840641accf6d9bbaa07ab21f722ff4587040c09.tar.xz
nvim-treesitter-8840641accf6d9bbaa07ab21f722ff4587040c09.tar.zst
nvim-treesitter-8840641accf6d9bbaa07ab21f722ff4587040c09.zip
TSModuleInfo: cleaner indentation
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/info.lua17
1 files changed, 7 insertions, 10 deletions
diff --git a/lua/nvim-treesitter/info.lua b/lua/nvim-treesitter/info.lua
index 6c63b8232..bbb32dad5 100644
--- a/lua/nvim-treesitter/info.lua
+++ b/lua/nvim-treesitter/info.lua
@@ -41,29 +41,26 @@ local function print_info_modules(parserlist)
table.sort(parserlist, function(a, b) return #a > #b end)
local max_str_len = #parserlist[1]
- local header = string.rep(' ', max_str_len + 2)
+ local header = string.rep(' ', max_str_len + 1)
local mods = configs.available_modules()
table.sort(mods)
for _, mod in pairs(mods) do
- header = string.format('%s%s ', header, mod)
+ header = string.format('%s %s ', header, mod)
end
- api.nvim_out_write(header..'\n')
+ api.nvim_out_write(header .. '\n')
table.sort(parserlist)
for _, lang in pairs(parserlist) do
- local padding = string.rep(' ', max_str_len - #lang)
- api.nvim_out_write(lang..":"..padding)
-
- for _, mod in pairs(configs.available_modules()) do
- local pad_len = #mod / 2 + 1
- api.nvim_out_write(string.rep(' ', pad_len))
+ local padding = string.rep(' ', max_str_len - #lang + 1)
+ api.nvim_out_write(lang .. ":" .. padding)
+ for _, mod in pairs(mods) do
if configs.is_enabled(mod, lang) then
api.nvim_out_write('✓')
else
api.nvim_out_write('✗')
end
- api.nvim_out_write(string.rep(' ', pad_len - 1))
+ api.nvim_out_write(string.rep(' ', #mod + 1))
end
api.nvim_out_write('\n')
end