Skip to content

Commit a94f7b8

Browse files
use small floating window for capture to destination instead of split.
1 parent f6c8746 commit a94f7b8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lua/orgmode/capture/init.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,24 @@ function Capture:_refile_to(file, lines, item, destination_line)
177177
return true
178178
end
179179

180-
local old_height = vim.api.nvim_win_get_height(0)
181180
if not is_same_file then
182-
vim.cmd('silent! topleft split ' .. file)
181+
local bufnr = vim.fn.bufadd(file)
182+
vim.api.nvim_open_win(bufnr, true, {
183+
relative = 'editor',
184+
width = 1,
185+
height = 1,
186+
row = 99999,
187+
col = 99999,
188+
zindex = 1,
189+
style = 'minimal',
190+
})
183191
end
184192

185193
vim.fn.append(destination_line, lines)
186194

187195
if not is_same_file then
188196
vim.cmd('silent! wq!')
189197
vim.api.nvim_set_current_win(cur_win)
190-
vim.cmd(string.format('silent! resize %d', old_height))
191198
end
192199

193200
if item then

0 commit comments

Comments
 (0)