Skip to content

Commit 9f2fb6c

Browse files
authored
fix(ui): check nil for buffer_state (#172)
1 parent 5ff191f commit 9f2fb6c

File tree

1 file changed

+4
-0
lines changed
  • lua/render-markdown/core

1 file changed

+4
-0
lines changed

lua/render-markdown/core/ui.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ function M.update(buf, win, parse)
8787

8888
local config = state.get_config(buf)
8989
local buffer_state = cache[buf]
90+
if not buffer_state then
91+
buffer_state = BufferState.new(buf)
92+
cache[buf] = buffer_state
93+
end
9094
local mode = vim.fn.mode(true)
9195

9296
local next_state = M.next_state(config, win, mode)

0 commit comments

Comments
 (0)