summaryrefslogtreecommitdiff
path: root/config/essentials/vis/vis-go.lua
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-06-23 15:23:48 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-06-23 15:23:48 +0200
commit1f7e952a75a870b0a4e9900964cae3729c216cc3 (patch)
tree5f8b8d5704d05e59fc55922a64957caaf2f569c3 /config/essentials/vis/vis-go.lua
parent8986d060f2f308ba768758ef9c3077f00f3d6b2a (diff)
checkpoint
Diffstat (limited to 'config/essentials/vis/vis-go.lua')
-rw-r--r--config/essentials/vis/vis-go.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/config/essentials/vis/vis-go.lua b/config/essentials/vis/vis-go.lua
index b0b383f..647e003 100644
--- a/config/essentials/vis/vis-go.lua
+++ b/config/essentials/vis/vis-go.lua
@@ -1,3 +1,12 @@
+--[[
+Based on https://gitlab.com/timoha/vis-go
+Changes made:
+- stylua format
+- check if line, col in godef()
+- no formatting because already handled by format.lua
+- removed the goimports option
+--]]
+
local function jump_to(path, line, col)
if path then
vis:command(string.format("e %s", path))
@@ -44,7 +53,9 @@ local function godef()
-- same file
line, col = string.match(out, "([^:]+):([^:]+)")
end
- jump_to(path, line, col)
+ if line and col then
+ jump_to(path, line, col)
+ end
end
local function godef_back()