From 7a52a370abd854731b0b26eb16c0636e34d28392 Mon Sep 17 00:00:00 2001 From: ray-x Date: Thu, 29 Feb 2024 12:58:19 +1100 Subject: [PATCH] It is a fix for the plugin working together with cmp-commandline --- lua/go/impl.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lua/go/impl.lua b/lua/go/impl.lua index 7bde470..4929168 100644 --- a/lua/go/impl.lua +++ b/lua/go/impl.lua @@ -16,10 +16,9 @@ local function get_type_name() local node_name = name.name -- let move the cursor to end of line of struct name local dim = name.dim.e - -- let move cursor local r, c = dim.r, dim.c utils.log('move cusror to ', r, c) - vim.api.nvim_win_set_cursor(0, { r, c }) + vim.api.nvim_win_set_cursor(0, { r, c - 1 }) return node_name, name.type end @@ -33,10 +32,9 @@ local function get_interface_name() local node_name = name.name -- let move the cursor to end of line of struct name local dim = name.dim.e - -- let move cursor local r, c = dim.r, dim.c utils.log('move cusror to ', r, c) - vim.api.nvim_win_set_cursor(0, { r, c }) + vim.api.nvim_win_set_cursor(0, { r, c - 1 }) local pkg = require('go.package').pkg_from_path(nil, vim.api.nvim_get_current_buf()) log(pkg[1])