diff options
| author | Michiel van den Heuvel <michielvdnheuvel@gmail.com> | 2023-06-08 19:17:52 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-06-12 18:23:30 +0200 |
| commit | 63b8d2ce0e0fd62833c4d795383411b77673ead6 (patch) | |
| tree | 2bde47a0e86a2d481c3269fc723d118ea6eaf253 /init.lua | |
| parent | 4dcc77f638829110b8b6417272fcbf07bde64a24 (diff) | |
| download | vis-lspc-63b8d2ce0e0fd62833c4d795383411b77673ead6.tar.gz vis-lspc-63b8d2ce0e0fd62833c4d795383411b77673ead6.zip | |
Avoid screen flicker when navigating within file
When using vis_open_doc_pos, don't reopen the file if the path of the
opened file and the doc_pos match.
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -299,9 +299,13 @@ local function vis_open_doc_pos(doc_pos, cmd, win) vis.win = win end assert(cmd) - vis:command(string.format('%s \'%s\'', cmd, doc_pos.file)) - vis.win.selection:to(doc_pos.line, doc_pos.col) - vis:command('lspc-open') + if vis.win.file.path ~= doc_pos.file then + vis:command(string.format('%s \'%s\'', cmd, doc_pos.file)) + vis.win.selection:to(doc_pos.line, doc_pos.col) + vis:command('lspc-open') + else + vis.win.selection:to(doc_pos.line, doc_pos.col) + end end -- Support jumping between document positions |
