You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(length (sexp-at-point)) does not return useful value in this context for strings with escape characters in them, e.g.:
(length"abc") ;=> 3
(length"abc\n") ;=> 4
In the example string "abc\n", the function needs to move over 5 characters to find the closing parenthesis it's looking for, but instead it only moves over 4, landing on the closing quote, and determining that this is not the last item in the def form and is therefore a docstring.
Is there a function that can be used to escape the string or otherwise find its "length including escape characters"? string-width nor string-bytes seem to be what we're after. Additionally, bounds-of-thing-at-point seems to be affected by the same logic error and so can't be used here.
Expected behavior
Highlighted as a normal string.
Actual behavior
Automatic indentation (unwanted in a string!) AND highlighted as a docstring.
Steps to reproduce the problem
Insert an escape character (\) to see the string switch to a docstring highlighting.
Eval
(clojure-in-docstring-p)
while the cursor is on the string to see that the result is wrong.Environment & Version information
clojure-mode version information
clojure-mode (version 5.11.0)
Emacs version
Emacs 26.2
Operating system
Ubuntu 18.04.3 LTS
The text was updated successfully, but these errors were encountered: