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 = {}
5
5
6
6
--- @private
7
7
--- @type string
8
- M .version = ' 5.1.2 '
8
+ M .version = ' 5.1.3 '
9
9
10
10
function M .check ()
11
11
vim .health .start (' markdown.nvim [version]' )
Original file line number Diff line number Diff line change 39
39
--- @param buf integer
40
40
--- @param change boolean
41
41
function M .debounce_update (buf , change )
42
- -- Check that buffer and associated window are valid
43
42
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
45
44
return
46
45
end
47
46
65
64
--- @param win integer
66
65
--- @param parse boolean
67
66
function M .update (buf , win , parse )
67
+ if not util .valid (buf , win ) then
68
+ return
69
+ end
70
+
68
71
local config = state .get_config (buf )
69
72
local buf_state = cache [buf ]
70
73
Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ function M.buf_to_win(buf)
16
16
return vim .fn .bufwinid (buf )
17
17
end
18
18
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
+
19
26
--- @param buf integer
20
27
--- @param win integer
21
28
--- @return integer ?
You can’t perform that action at this time.
0 commit comments