From 8129ea9d2c807c4828f5227200047bbbdb1d112a Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 3 Nov 2022 13:09:27 +0900 Subject: [PATCH] Fix errors not stopping fn execution --- plugin/quickcomment.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/quickcomment.lua b/plugin/quickcomment.lua index 0a248be..4fbac6d 100644 --- a/plugin/quickcomment.lua +++ b/plugin/quickcomment.lua @@ -21,6 +21,7 @@ vim.g.quickcomment_togglecommentlines = function (line_start, line_end) local comment_string = vim.api.nvim_buf_get_option(0, 'commentstring') if comment_string == nil then print('QuickComment: ERROR: Unable to get comment string, "commentstring" is not defined!') + return end local sub_find, sub_end = comment_string:find('%%s') local escaped_string = '' @@ -43,6 +44,7 @@ vim.g.quickcomment_togglecommentlines = function (line_start, line_end) lines[i] = captured else print('QuickComment: ERROR: Failed to uncomment!') + return end end end