Skip to content

Added as and move keywords to Vim syntax file #18782

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

Closed
wants to merge 1 commit into from

Conversation

netvl
Copy link
Contributor

@netvl netvl commented Nov 8, 2014

as (already for a long time) and move (which was only added recently, AFAIK) are not marked as keywords in Vim syntax file, so they are not highlighted as keywords in Rust sources. This PR fixes this.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

@steveklabnik
Copy link
Member

Move has been a keyword for a long time, but it was removed in 0.6, and kept reserved. Then it was recently brought back.=

@netvl
Copy link
Contributor Author

netvl commented Nov 8, 2014

@steveklabnik, didn't know that. Anyway, previously it wasn't used so its missing highlighting wasn't a problem. as, however, is a [frequently] used keyword for a long time, but for some reason it still wasn't marked as such in Vim syntax file.

@@ -23,7 +23,7 @@ syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
syn keyword rustKeyword continue
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
syn keyword rustKeyword for in if impl let
syn keyword rustKeyword for in if impl let as move
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as is already a rustOperator (see line 17), so marking it as a keyword as well is unnecessary. as is already highlighted in Vim today.

@tomjakubowski
Copy link
Contributor

Could you squeeze in an update to rustFail "\<fail\(\w\)*!" contained for panic! too?

@netvl
Copy link
Contributor Author

netvl commented Nov 9, 2014

@P1start, strange, it is not highlighted for me. Probably my color scheme problems, I'll revert it.
As for panic!(), sure, I'll do it.

@netvl netvl force-pushed the update-vim-syntax branch from a3d8987 to 3961eae Compare November 9, 2014 18:10
@netvl
Copy link
Contributor Author

netvl commented Nov 9, 2014

Ah, I see that since as is deemed an operator it is highlighted as such and operators in my color scheme do not have a particular highlighting. Never thought of as as an operator though >_<
Anyway, I fixed everything and also rewrote fail to panic.

bors added a commit that referenced this pull request Nov 10, 2014
`as` (already for a long time) and `move` (which was only added recently, AFAIK) are not marked as keywords in Vim syntax file, so they are not highlighted as keywords in Rust sources. This PR fixes this.
@bors bors closed this Nov 10, 2014
@cuviper
Copy link
Member

cuviper commented Nov 10, 2014

@netvl, did you consider rustStorage for move? That's what I chose in #18789. Then it will be highlighted the same way as ref, mut, and the & sigil, for instance, all mapping to vim's StorageClass. If you agree, I can rebase my pull request to change where you put it. :)

@netvl netvl deleted the update-vim-syntax branch November 10, 2014 18:31
@netvl
Copy link
Contributor Author

netvl commented Nov 10, 2014

@cuviper, no, I didn't. Either would be fine for me, as long as they are highlighted :)

bors added a commit that referenced this pull request Nov 11, 2014
It used to be in `rustKeyword`, until commit 5c75f21 removed it, and then #18782 restored it again.  However, this is now a closure modifier, and I think moving it to `rustStorage` is more appropriate to highlight it similarly to `mut`, `ref`, and the `&` sigil.
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 28, 2025
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.

8 participants