We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
anyQuote
1 parent b3910e6 commit fd355c9Copy full SHA for fd355c9
1 file changed
lua/various-textobjs/textobjs/charwise.lua
@@ -31,8 +31,13 @@ end
31
32
---@param scope "inner"|"outer"
33
function M.anyQuote(scope)
34
- -- INFO `%f[\"]` is the lua frontier pattern, and effectively used as a negative
35
- -- lookbehind, that is ensuring that the previous character may not be a `\`.
+ -- INFO
+ -- `(").-(")` would be enough if we were just to check for any quote character.
36
+ --
37
+ -- To handle escaped quotes, we use make use of frontier patterns and handle
38
+ -- various edge cases. `%f[\"]` is the lua frontier pattern, and effectively
39
+ -- used as a negative lookbehind, that is ensuring that the previous
40
+ -- character may not be a `\`.
41
local patterns = {
42
['"'] = [[(%f[\"]").-(%f[\"]")]],
43
["'"] = [[(%f[\']').-(%f[\']')]],
0 commit comments