File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,17 @@ local get_current_line_for_printing = function(current_line)
51
51
vim .api .nvim_buf_get_lines (0 , current_line - 1 , current_line , true )[1 ]
52
52
53
53
-- Remove whitespace and any quoting characters which could potentially
54
- -- cause a syntax error in the statement being printed.
54
+ -- cause a syntax error in the statement being printed, or any characters
55
+ -- which could cause unintended interpolation of expressions
55
56
current_line_contents = current_line_contents :gsub (" ^%s+" , " " )
56
57
current_line_contents = current_line_contents :gsub (" %s+$" , " " )
57
58
current_line_contents = current_line_contents :gsub (' "' , " " )
58
59
current_line_contents = current_line_contents :gsub (" '" , " " )
59
60
current_line_contents = current_line_contents :gsub (" \\ " , " " )
60
61
current_line_contents = current_line_contents :gsub (" `" , " " )
62
+ current_line_contents = current_line_contents :gsub (" %$" , " " )
63
+ current_line_contents = current_line_contents :gsub (" {" , " " )
64
+ current_line_contents = current_line_contents :gsub (" }" , " " )
61
65
62
66
if current_line_contents :len () > MAX_SNIPPET_LENGTH then
63
67
current_line_contents = string.sub (
You can’t perform that action at this time.
0 commit comments