We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40ac8bf commit a09d2efCopy full SHA for a09d2ef
1 file changed
lua/dashboard/theme/doom.lua
@@ -135,11 +135,12 @@ local function generate_center(config)
135
-- FIX: #422: In Lua the length of a string is the number of bytes not
136
-- the number of characters.
137
local curline_str = api.nvim_buf_get_lines(config.bufnr, curline - 1, curline, false)[1]
138
- local offset = col_width - api.nvim_strwidth(curline_str:sub(1, col + 1))
139
- if offset < 0 then
140
- offset = 0
+ local strwidth = api.nvim_strwidth(curline_str:sub(1, col + 1))
+ local col_with_offset = col + col_width - strwidth
+ if col_with_offset < 0 then
141
+ col_with_offset = 0
142
end
- api.nvim_win_set_cursor(config.winid, { curline, col + offset })
143
+ api.nvim_win_set_cursor(config.winid, { curline, col_with_offset })
144
end,
145
})
146
end, 0)
0 commit comments