Skip to content

Commit 384976a

Browse files
rob-3Robitx
authored andcommitted
feat(config): allow turning off G in GpChats
1 parent 17b775a commit 384976a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lua/gp/config.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ local config = {
121121
chat_finder_pattern = "topic ",
122122
-- if true, finished ChatResponder won't move the cursor to the end of the buffer
123123
chat_free_cursor = false,
124+
-- control whether to type G whenever the chat buffer is focused
125+
jump_to_bottom = true,
124126

125127
-- how to display GpChatToggle or GpContext: popup / split / vsplit / tabnew
126128
toggle_target = "vsplit",

lua/gp/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,9 @@ M.prep_md = function(buf)
13661366
buf = buf or vim.api.nvim_get_current_buf()
13671367

13681368
-- move cursor to a new line at the end of the file
1369-
M._H.feedkeys("G", "x")
1369+
if M.config.jump_to_bottom then
1370+
M._H.feedkeys("G", "x")
1371+
end
13701372

13711373
-- ensure normal mode
13721374
vim.api.nvim_command("stopinsert")

0 commit comments

Comments
 (0)