From e735a2d9d08b78e28d8fb9826f3ad0e612dec59c Mon Sep 17 00:00:00 2001
From: m0rphism <m0rphism@users.noreply.github.com>
Date: Mon, 15 Jul 2024 23:14:22 +0200
Subject: [PATCH] Fix GotoDefinition

Workaround for #154
---
 src/Plugin.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Plugin.hs b/src/Plugin.hs
index 798d169..8347275 100644
--- a/src/Plugin.hs
+++ b/src/Plugin.hs
@@ -65,7 +65,7 @@ gotoDefinition = withAgda $ do
       vim_command $ "edit " <> ds_filepath ds
       b' <- window_get_buffer w
       contents <- fmap (T.unlines . V.toList) $ buffer_get_lines b' 0 (-1) False
-      let buffer_idx = toBytes contents $ zeroIndex $ ds_position ds
+      let buffer_idx = toBytes contents $ incIndex $ zeroIndex $ ds_position ds
       -- TODO(sandy): use window_set_cursor instead?
       vim_command $ "keepjumps normal! " <> T.pack (show buffer_idx) <> "go"