aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel van den Heuvel <michielvdnheuvel@gmail.com>2023-11-21 13:58:37 +0100
committerMichiel van den Heuvel <michielvdnheuvel@gmail.com>2023-11-21 13:58:37 +0100
commit17e40a5be84b51fa004a985c004d3ff34e477662 (patch)
tree9a86053d514946e99a65fd65a344568d3b6964e0
parent754dad10d3a8434d0c23f919b592d76aa32ace46 (diff)
downloadvis-lspc-17e40a5be84b51fa004a985c004d3ff34e477662.tar.gz
vis-lspc-17e40a5be84b51fa004a985c004d3ff34e477662.zip
Fix lscp.open_file not actually adding to history
-rw-r--r--init.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index ff473f0..16e3950 100644
--- a/init.lua
+++ b/init.lua
@@ -428,10 +428,6 @@ local function vis_open_doc_pos(doc_pos, cmd, win)
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 = {}
@@ -451,6 +447,10 @@ local function vis_open_new_doc_pos(doc_pos, cmd, win)
vis_open_doc_pos(doc_pos, cmd, win)
end
+lspc.open_file = function(win, path, line, col, cmd)
+ vis_open_new_doc_pos({file = path, line = line, col = col}, cmd or 'e', win)
+end
+
local function vis_pop_doc_pos(win)
local last_doc_pos = table.remove(doc_pos_history)
if not last_doc_pos then