diff options
| author | luukvbaal <luukvbaal@gmail.com> | 2025-04-22 13:34:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-22 04:34:41 -0700 |
| commit | d3e495ce03e3389c2c28ffcfe2e41c088a37f1ef (patch) | |
| tree | cd1116ba5e43277000ed2400bf6ed9578a8e024c /runtime/lua | |
| parent | 8c81ed86786ad155b262cfa04bd56a5794fe97ec (diff) | |
| download | rneovim-d3e495ce03e3389c2c28ffcfe2e41c088a37f1ef.tar.gz rneovim-d3e495ce03e3389c2c28ffcfe2e41c088a37f1ef.tar.bz2 rneovim-d3e495ce03e3389c2c28ffcfe2e41c088a37f1ef.zip | |
perf(snippet): use "[count]|" to move cursor #33571
Problem:
Flicker when using vim.snippet.jump().
Solution:
Pass count instead of multiple <right> keys.
Diffstat (limited to 'runtime/lua')
| -rw-r--r-- | runtime/lua/vim/snippet.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/runtime/lua/vim/snippet.lua b/runtime/lua/vim/snippet.lua index 6d572fed34..e84a9e376a 100644 --- a/runtime/lua/vim/snippet.lua +++ b/runtime/lua/vim/snippet.lua @@ -284,9 +284,7 @@ local function select_tabstop(tabstop) --- @param row integer --- @param col integer local function move_cursor_to(row, col) - local line = vim.fn.getline(row) --[[ @as string ]] - col = math.max(vim.fn.strchars(line:sub(1, col)) - 1, 0) - feedkeys(string.format('%sG0%s', row, string.rep('<Right>', col))) + feedkeys(string.format('%sG%s|', row, col)) end local range = tabstop:get_range() |