fix: check parser nil #29

This commit is contained in:
zztrieuzz 2021-10-08 19:34:40 +07:00
parent 99ba1f6d80
commit a8f4a3246a
2 changed files with 20 additions and 0 deletions

17
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@ -265,6 +265,9 @@ end
M.close_tag = function ()
parsers.get_parser():parse()
local buf_parser = parsers.get_parser()
if not buf_parser then return end
buf_parser:parse()
local result, tag_name = check_close_tag()
if result == true and tag_name ~= nil then
vim.cmd(string.format([[normal! a</%s>]],tag_name))