Skip to content

Commit a185424

Browse files
committed
Add separators when showing diff/prompt/selection windows
Makes the display a bit nicer Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
1 parent 83bb411 commit a185424

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lua/CopilotChat/init.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@ function M.setup(config)
863863
ctxlen = #selection.lines,
864864
}))
865865

866+
diff = diff .. '\n' .. M.config.separator .. '\n'
866867
state.diff:show(diff, filetype, 'diff', state.chat.winnr)
867868
end
868869
end)
@@ -873,6 +874,7 @@ function M.setup(config)
873874
return
874875
end
875876

877+
prompt = prompt .. '\n' .. M.config.separator .. '\n'
876878
state.system_prompt:show(prompt, 'markdown', 'markdown', state.chat.winnr)
877879
end)
878880

@@ -884,9 +886,12 @@ function M.setup(config)
884886

885887
local filetype = selection.filetype or vim.bo[state.source.bufnr].filetype
886888
local lines = selection.lines
887-
if vim.trim(lines) ~= '' then
888-
state.user_selection:show(lines, filetype, filetype, state.chat.winnr)
889+
if vim.trim(lines) == '' then
890+
return
889891
end
892+
893+
lines = lines .. '\n' .. M.config.separator .. '\n'
894+
state.user_selection:show(lines, filetype, filetype, state.chat.winnr)
890895
end)
891896

892897
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufLeave' }, {

0 commit comments

Comments
 (0)