diff options
| author | Michiel van den Heuvel <michielvdnheuvel@gmail.com> | 2023-08-27 16:20:46 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-08-28 20:02:46 +0200 |
| commit | 795beac9e6a98794fd8320bd2317e01ed329148b (patch) | |
| tree | 6b7d4fda3b4b655c64976a09f468710549696634 /init.lua | |
| parent | 5b293adcda95896291dc7943d12c3e34906657ab (diff) | |
| download | vis-lspc-795beac9e6a98794fd8320bd2317e01ed329148b.tar.gz vis-lspc-795beac9e6a98794fd8320bd2317e01ed329148b.zip | |
Add function to open a file to lspc object
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -419,13 +419,19 @@ local function vis_open_doc_pos(doc_pos, cmd, win) end end vis_open_file(doc_pos.file, cmd) - vis.win.selection:to(doc_pos.line, doc_pos.col) + if doc_pos.line then + vis.win.selection:to(doc_pos.line, doc_pos.col or 0) + end vis:command('lspc-open') else vis.win.selection:to(doc_pos.line, doc_pos.col) end end +lspc.open_file = function(win, path, line, col, cmd) + vis_open_doc_pos({file = path, line = line, col = col}, cmd or 'e', win) +end + -- Support jumping between document positions -- Stack of edited document positions local doc_pos_history = {} |
