Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Keyword and Symbol prefix matching #27

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

Merged
axvr merged 7 commits into clojure-vim:master from Invertisment:master
Jan 7, 2023
Merged

Conversation

Copy link
Contributor

@Invertisment Invertisment commented Aug 31, 2022
edited
Loading

This adds prefix matching to the keywords and symbols but not to namespaced functions (I may add this later, not sure how yet)

The default highlighting is not too obtrusive (it's possible to match symbol's and keyword's namespace but they're left to be the same as the item itself (symbol is white-on-white in this colorscheme as it's regarded to as Normal already)):

image

axvr reacted with heart emoji
Copy link
Member

axvr commented Sep 1, 2022
edited
Loading

Excellent! Thanks for this. I will take a look at it (and test it) in the next few days and hopefully we can get it merged soon.

Copy link
Member

axvr commented Sep 1, 2022

(Also the syntax tests are failing, but as they are still quite complicated, I'm happy to fix them for you once I test it myself and confirm that this PR is good and won't require additional changes.)

Copy link
Contributor Author

I didn't know about syntax tests, oops :D Probably it's described in the README but I didn't read most of it.
And I also didn't add the namespace matching for Clojure's symbols so probably that may need to be added too.

Copy link
Contributor Author

I fixed tests.
This PR is related to #24

Copy link
Contributor Author

Invertisment commented Sep 5, 2022
edited
Loading

(削除) I tried to use my fork to preview the colors for myself and for some reason I can't set the color for clojureKeywordNs. Is it that the default somehow interferes? (削除ここまで)

Edit: Found that I used a theme package that had old themes

Copy link
Contributor Author

Invertisment commented Sep 5, 2022
edited
Loading

I found that I had messed up the tests so I fixed them by editing the test macro.
I made it so that I could use that macro to do equality checks, not only the "collection-contains" checks as it was used before.

And one more problem that I face is that I can't greedily match : without introducing two keyword syntax regions. I don't know how to fix this. See tests and look for :clojureKeywordNsColon :clojureKeywordNsColon.

It also decides to split the keyword into many parts and that's also bad. Not greedy enough.

Copy link
Contributor Author

Invertisment commented Sep 6, 2022
edited
Loading

Not sure why but the variant that I use breaks the parens when I change colorschemes:
image

Probably that could mean that namespace regex should include parens as keyword/symbol regex does.

Well it doesn't work this way from the start and since I don't change the colorschemes it doesn't come up anymore. Weird. Probably artifact of changing the colors.

Copy link
Contributor Author

Invertisment commented Sep 13, 2022
edited
Loading

Recent fixes allow for this matching (when ( is starting but the keyword is touching it (the cursor is on the w in :keyw)):
image

I also think that it would be a good thing to refactor custom testing macros (at least in keyword and symbol matching) into clojure.test/are so that there wouldn't be a need to define every match expression as a variable.

Copy link
Member

axvr commented Jan 7, 2023

Something's glitched on GitHub's PR checks, it won't run the CI again :( so I can't merge through the UI.

I'll merge it manually.

@axvr axvr merged commit 06196d8 into clojure-vim:master Jan 7, 2023
Copy link
Member

axvr commented Jan 7, 2023

Merged. Thank you for working on this! Also see: #24 (comment)

@axvr axvr linked an issue Jun 23, 2023 that may be closed by this pull request
@axvr axvr added the highlighting Affects syntax highlighting label Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@axvr axvr axvr approved these changes

Assignees
No one assigned
Labels
highlighting Affects syntax highlighting
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Is there a way to highlight namespace of a keyword separately?

AltStyle によって変換されたページ (->オリジナル) /