Skip to content

Commit d0678f6

Browse files
Do not automatically resize agenda view if manually resized. Closes #219.
1 parent 8e97e5f commit d0678f6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/orgmode/agenda/init.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,16 @@ function Agenda:_render(skip_rebuild)
121121
vim.cmd(string.format('%dsplit orgagenda', win_height))
122122
vim.cmd([[setf orgagenda]])
123123
vim.cmd([[setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap nospell]])
124+
vim.w.org_window_pos = vim.fn.win_screenpos(0)
124125
config:setup_mappings('agenda')
125126
else
126-
vim.cmd(string.format('resize %d', win_height))
127127
vim.cmd(vim.fn.win_id2win(opened) .. 'wincmd w')
128+
if vim.w.org_window_pos and vim.deep_equal(vim.fn.win_screenpos(0), vim.w.org_window_pos) then
129+
vim.cmd(string.format('resize %d', win_height))
130+
vim.w.org_window_pos = vim.fn.win_screenpos(0)
131+
else
132+
vim.w.org_window_pos = nil
133+
end
128134
end
129135
local lines = vim.tbl_map(function(item)
130136
return item.line_content

0 commit comments

Comments
 (0)