diff --git a/lua/gp/config.lua b/lua/gp/config.lua index 2c426905..a87dd09a 100644 --- a/lua/gp/config.lua +++ b/lua/gp/config.lua @@ -121,6 +121,8 @@ local config = { chat_finder_pattern = "topic ", -- if true, finished ChatResponder won't move the cursor to the end of the buffer chat_free_cursor = false, + -- control whether to type G whenever the chat buffer is focused + jump_to_bottom = true, -- how to display GpChatToggle or GpContext: popup / split / vsplit / tabnew toggle_target = "vsplit", diff --git a/lua/gp/init.lua b/lua/gp/init.lua index 567e95ff..91cbbef2 100644 --- a/lua/gp/init.lua +++ b/lua/gp/init.lua @@ -1366,7 +1366,9 @@ M.prep_md = function(buf) buf = buf or vim.api.nvim_get_current_buf() -- move cursor to a new line at the end of the file - M._H.feedkeys("G", "x") + if M.config.jump_to_bottom then + M._H.feedkeys("G", "x") + end -- ensure normal mode vim.api.nvim_command("stopinsert")