patch 8.2.3938: line comment start is also found in a string
Problem: Line comment start is also found in a string.
Solution: Skip line comments in a string.
diff --git a/src/testdir/test_textformat.vim b/src/testdir/test_textformat.vim
index ccfd36f..6402989 100644
--- a/src/testdir/test_textformat.vim
+++ b/src/testdir/test_textformat.vim
@@ -261,6 +261,21 @@
END
call assert_equal(expected, getline(1, '$'))
+ " Using "o" does not repeat a comment in a string
+ %del
+ let text =<< trim END
+ nop;
+ val = " // This is not a comment";
+ END
+ call setline(1, text)
+ normal 2Gox
+ let expected =<< trim END
+ nop;
+ val = " // This is not a comment";
+ x
+ END
+ call assert_equal(expected, getline(1, '$'))
+
" Using CTRL-U after "o" fixes the indent
%del
let text =<< trim END