Skip to content

Commit b05145c

Browse files
committed
Set calendar buffer as nonmodifiable
Users should not be able to modify the calendar popup buffer. This sets modifiable as false for the buffer after rendering it.
1 parent a826b44 commit b05145c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/orgmode/objects/calendar.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ function Calendar.open()
7171
end
7272

7373
function Calendar.render()
74+
vim.api.nvim_buf_set_option(Calendar.buf, 'modifiable', true)
75+
7476
local first_row = { 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' }
7577
local content = { {}, {}, {}, {}, {}, {} }
7678
local start_weekday = Calendar.month:get_isoweekday()
@@ -112,6 +114,8 @@ function Calendar.render()
112114
end
113115
end
114116
end
117+
118+
vim.api.nvim_buf_set_option(Calendar.buf, 'modifiable', false)
115119
end
116120

117121
function Calendar.forward()

0 commit comments

Comments
 (0)