aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormax397574 <[email protected]>2021-10-22 18:20:52 +0200
committermax397574 <[email protected]>2021-10-22 18:20:52 +0200
commitecc5176ca675f32edcef86dcc40227204ddcebb1 (patch)
tree8db84c1f858804eb21c4a5e8f2ce40521db4de5c
parent75cf115e9730120412202e0a038474f5dbbd7664 (diff)
refactor(plugin): 🔄set lines in mapping names with empty and fix column
not being an int
-rw-r--r--lua/startup.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/startup.lua b/lua/startup.lua
index f1d3f0c..6ce4878 100644
--- a/lua/startup.lua
+++ b/lua/startup.lua
@@ -51,7 +51,7 @@ function M.open_section()
vim.api.nvim_buf_set_lines(0, line_nr, line_nr, false, section_entries)
table.insert(M.open_sections, section_name)
vim.cmd [[silent! %s/\s\+$//]] -- clear trailing whitespace
- vim.api.nvim_win_set_cursor(0, { line_nr, vim.o.columns / 2 })
+ vim.api.nvim_win_set_cursor(0, { line_nr, math.floor(vim.o.columns / 2) })
vim.api.nvim_buf_set_option(0, "modifiable", false)
end
@@ -167,9 +167,6 @@ function M.mapping_names(mappings)
local mapnames = {}
local length = utils.longest_line(mappings) + 5
for name, cmd in pairs(mappings) do
- if settings.options.empty_lines_between_mappings then
- table.insert(mapnames, " ")
- end
if settings.options.mapping_keys then
local space = utils.spaces(length - #cmd[2] - #name)
table.insert(mapnames, name .. space .. cmd[2])
@@ -263,6 +260,9 @@ function M.display()
M.lines,
{ line, options.align, false, options.highlight }
)
+ if settings.options.empty_lines_between_mappings then
+ empty(1)
+ end
end
end
table.insert(sections_with_mappings, part)