Skip to content

Commit

Permalink
Fix append_selection, missing placeholder render call
Browse files Browse the repository at this point in the history
  • Loading branch information
frankroeder committed Jan 24, 2025
1 parent d7f9bec commit 9ef0b80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 0 additions & 4 deletions lua/parrot/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,11 @@ local defaults = {
template_selection = [[
I have the following content from {{filename}}:
<SELECTION>
```{{filetype}}
{{selection}}
```
</SELECTION>
<FURTHER CONTEXT>
{{command}}
</FURTHER CONTEXT>
]],
template_rewrite = [[
I have the following content from {{filename}}:
Expand Down
6 changes: 4 additions & 2 deletions lua/parrot/utils.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local pft = require("plenary.filetype")
local Placeholders = require("parrot.placeholders")

local M = {}

Expand Down Expand Up @@ -256,8 +257,9 @@ M.append_selection = function(params, origin_buf, target_buf, template_selection
local fname = vim.api.nvim_buf_get_name(origin_buf)
local filecontent = table.concat(vim.api.nvim_buf_get_lines(origin_buf, 0, -1, false), "\n")
local multifilecontent = M.get_all_buffer_content()
local rendered =
M.template_render(template_selection, "", selection, filetype, fname, filecontent, multifilecontent)
local _placeholders =
Placeholders:new(template_selection, "", selection, filetype, fname, filecontent, multifilecontent)
local rendered = _placeholders:return_render()
if rendered then
selection = rendered
end
Expand Down

0 comments on commit 9ef0b80

Please sign in to comment.