-
-
Notifications
You must be signed in to change notification settings - Fork 247
[Fix #445] def form with strings and docstrings #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ values of customisable variables." | |
(search-forward "|") | ||
(delete-char -1) | ||
(clojure-mode) | ||
(font-lock-ensure) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can this affect an indentation test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is because the indentation command behaves differently depending on whether font lock mode is ON or OFF, in the case of docstrings. This branch is master with the test added: https://github.com/carlosgeos/clojure-mode/tree/temp-branch. The tests are fine, but if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, that’s odd. Turning on the mode should enable the font locking. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually yes, but apparently not when using temp-buffer: https://stackoverflow.com/a/23569337 |
||
(indent-according-to-mode) | ||
|
||
(should (equal expected-state (buffer-string))) | ||
|
@@ -118,6 +119,10 @@ values of customisable variables." | |
(->> | ||
|expr)") | ||
|
||
(check-indentation no-indent-for-def-string | ||
"(def foo \"hello|\")" | ||
"(def foo \"hello|\")") | ||
|
||
(check-indentation doc-strings-without-indent-specified | ||
" | ||
(defn some-fn | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary given the
goto-char
below?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first
goto-char
looks redundant but I think it is not, because there is a(sexp-at-point)
below, and it needs the point at the correct position beforehand.Also, the
(sexp-at-point)
form does not take any arguments so I cannot passstartpos
to it.Anyway, I tried without it and it didn't work. Happy to remove it if we find the way to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, great point. I didn't think of that! Yeah, we definitely need it because of the
(sexp-at-point)
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead and squash if you like. I will merge once I have the rights to do so.