File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ local M = {}
55
66--- @private
77--- @type string
8- M .version = ' 5.1.2 '
8+ M .version = ' 5.1.3 '
99
1010function M .check ()
1111 vim .health .start (' markdown.nvim [version]' )
Original file line number Diff line number Diff line change 3939--- @param buf integer
4040--- @param change boolean
4141function M .debounce_update (buf , change )
42- -- Check that buffer and associated window are valid
4342 local win = util .buf_to_win (buf )
44- if not vim . api . nvim_buf_is_valid (buf ) or not vim . api . nvim_win_is_valid ( win ) then
43+ if not util . valid (buf , win ) then
4544 return
4645 end
4746
6564--- @param win integer
6665--- @param parse boolean
6766function M .update (buf , win , parse )
67+ if not util .valid (buf , win ) then
68+ return
69+ end
70+
6871 local config = state .get_config (buf )
6972 local buf_state = cache [buf ]
7073
Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ function M.buf_to_win(buf)
1616 return vim .fn .bufwinid (buf )
1717end
1818
19+ --- @param buf integer
20+ --- @param win integer
21+ --- @return boolean
22+ function M .valid (buf , win )
23+ return vim .api .nvim_buf_is_valid (buf ) and vim .api .nvim_win_is_valid (win )
24+ end
25+
1926--- @param buf integer
2027--- @param win integer
2128--- @return integer ?
You can’t perform that action at this time.
0 commit comments