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

Commit 6646cce

Browse files
committed
Rename "comment reader macro" to "discard"
This also solves the problem where "comment" needed to be misspelt for vim-sexp would work correctly.
1 parent 232e56e commit 6646cce

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

‎indent/clojure.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ if exists("*searchpairpos")
5656
endfunction
5757

5858
function! s:ignored_region()
59-
let name = s:syn_id_name()
60-
return (name =~? '\vstring|regex|comment|character') && (name !~# '^clojureCommentReaderMacro\(Form\)\?$')
59+
return s:syn_id_name() =~? '\vstring|regex|comment|character'
6160
endfunction
6261

6362
function! s:current_char()

‎syntax/clojure.vim

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,21 @@ syntax keyword clojureCommentTodo contained FIXME XXX TODO BUG NOTE HACK FIXME:
134134
syntax match clojureComment ";.*$" contains=clojureCommentTodo,@Spell
135135
syntax match clojureComment "#!.*$"
136136

137-
" Comment forms highlight comment forms as comment. Based on: <https://git.sr.ht/~evhan/vim-scheme/>
138-
syntax region clojureComentReaderMacro matchgroup=clojureComentReaderMacro start=/#_[ ,\t\n`'~]*/ end=/[, \t\n()\[\]{}";]/me=e-1
139-
syntax region clojureComentReaderMacro matchgroup=clojureComentReaderMacro start=/#_[ ,\t\n`'~]*"/ skip=/\\[\\"]/ end=/"/
140-
syntax region clojureComentReaderMacro matchgroup=clojureComentReaderMacro start=/#_[ ,\t\n`'~]*(/ end=/)/ contains=clojureComentReaderMacroForm
141-
syntax region clojureComentReaderMacro matchgroup=clojureComentReaderMacro start=/#_[ ,\t\n`'~]*\[/ end=/\]/ contains=clojureComentReaderMacroForm
142-
syntax region clojureComentReaderMacro matchgroup=clojureComentReaderMacro start=/#_[ ,\t\n`'~]*{/ end=/}/ contains=clojureComentReaderMacroForm
143-
144-
syntax region clojureComentReaderMacroForm start="(" end=")" contained contains=clojureComentReaderMacroForm
145-
syntax region clojureComentReaderMacroForm start="{" end="}" contained contains=clojureComentReaderMacroForm
146-
syntax region clojureComentReaderMacroForm start="\[" end="\]" contained contains=clojureComentReaderMacroForm
137+
" Comment out discarded forms. <https://clojure.org/guides/weird_characters#_discard>
138+
" TODO: stacking support and/or option to enable/disable this.
139+
syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*/ end=/[, \t\n()\[\]{}";]/me=e-1
140+
syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*"/ skip=/\\[\\"]/ end=/"/
141+
syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*(/ end=/)/ contains=clojureDiscardForm
142+
syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*\[/ end=/\]/ contains=clojureDiscardForm
143+
syntax region clojureDiscard matchgroup=clojureDiscard start=/#_[ ,\t\n`'~]*{/ end=/}/ contains=clojureDiscardForm
144+
145+
syntax region clojureDiscardForm start="(" end=")" contained contains=clojureDiscardForm
146+
syntax region clojureDiscardForm start="{" end="}" contained contains=clojureDiscardForm
147+
syntax region clojureDiscardForm start="\[" end="\]" contained contains=clojureDiscardForm
147148

148149
" -*- TOP CLUSTER -*-
149150
" Generated from https://github.com/clojure-vim/clojure.vim/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj
150-
syntax cluster clojureTop contains=@Spell,clojureAnonArg,clojureBoolean,clojureCharacter,clojureComment,clojureCond,clojureConstant,clojureDefine,clojureDeref,clojureDispatch,clojureError,clojureException,clojureFunc,clojureKeyword,clojureMacro,clojureMap,clojureMeta,clojureNumber,clojureQuote,clojureRegexp,clojureRepeat,clojureSexp,clojureSpecial,clojureString,clojureSymbol,clojureUnquote,clojureVarArg,clojureVariable,clojureVector,clojureComentReaderMacro
151+
syntax cluster clojureTop contains=@Spell,clojureAnonArg,clojureBoolean,clojureCharacter,clojureComment,clojureCond,clojureConstant,clojureDefine,clojureDeref,clojureDispatch,clojureError,clojureException,clojureFunc,clojureKeyword,clojureMacro,clojureMap,clojureMeta,clojureNumber,clojureQuote,clojureRegexp,clojureRepeat,clojureSexp,clojureSpecial,clojureString,clojureSymbol,clojureUnquote,clojureVarArg,clojureVariable,clojureVector,clojureDiscard
151152

152153
syntax region clojureSexp matchgroup=clojureParen start="(" end=")" contains=@clojureTop fold
153154
syntax region clojureVector matchgroup=clojureParen start="\[" end="]" contains=@clojureTop fold
@@ -202,8 +203,8 @@ highlight default link clojureDispatch SpecialChar
202203

203204
highlight default link clojureComment Comment
204205
highlight default link clojureCommentTodo Todo
205-
highlight default link clojureComentReaderMacro clojureComment
206-
highlight default link clojureComentReaderMacroForm clojureComentReaderMacro
206+
highlight default link clojureDiscard clojureComment
207+
highlight default link clojureDiscardForm clojureDiscard
207208

208209
highlight default link clojureError Error
209210

0 commit comments

Comments
(0)

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