Skip to content
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

Fix character font lock #588

Merged
merged 1 commit into from May 4, 2021

Conversation

rvlo
Copy link
Contributor

@rvlo rvlo commented Mar 22, 2021

Characters escaped weren't being formatted correctly, as shown by the submitted test.

Example of code that wasn't being formatted:
["text" \, "other"]
(str \[ "inside" \])


Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):

  • The commits are consistent with our contribution guidelines.
  • You've added tests (if possible) to cover your change(s). Bugfix, indentation, and font-lock tests are extremely important!
  • You've run M-x checkdoc and fixed any warnings in the code you've written.
  • You've updated the changelog (if adding/changing user-visible functionality).
  • You've updated the readme (if adding/changing user-visible functionality).

Thanks!

@rvlo
Copy link
Contributor Author

rvlo commented Mar 24, 2021

I also propose moving the lambda arguments regex below character literals, for handling \% correctly. Would there be any problems in doing so?

@bbatsov
Copy link
Member

bbatsov commented May 2, 2021

You'll have to check this. The font-locking logic is quite brittle.

The changes you proposed look reasonable. Please, mention the fix in the changelog.

When inside a vector or before white space, some escaped characters,
like comma, square and curly brackets, weren't being formatted.

* Added tests.
* Added examples in test.clj for visual inspection.
@rvlo rvlo force-pushed the fix-character-font-lock branch from 7274062 to f0eee5a Compare May 4, 2021 13:23
@rvlo
Copy link
Contributor Author

rvlo commented May 4, 2021

I added a test for the % character literal, moved the lambda arguments below character literals, added an entry to the changelog, rebased on master and squashed the commits.

@bbatsov bbatsov merged commit e440080 into clojure-emacs:master May 4, 2021
@bbatsov
Copy link
Member

bbatsov commented May 4, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants