Skip to content

Commit

Permalink
Don't conceal “is” and “is not” (#15)
Browse files Browse the repository at this point in the history
To make it possible to distinguish between `is`/`is not` and `==`/`!=`,
the former pair will not be concealed.
  • Loading branch information
ehamberg committed Mar 3, 2012
1 parent 39ad34e commit b1a39eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions after/syntax/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ syntax match pythonOperator "\<is\>"
syntax match pyNiceOperator "\<in\>" conceal cchar=
syntax match pyNiceOperator "\<or\>" conceal cchar=
syntax match pyNiceOperator "\<and\>" conceal cchar=
" show “is not” as ≠
syntax match pyNiceOperator "\<is not\>" conceal cchar=
" include the space after “not” – if present – so that “not a” becomes “¬a”
syntax match pyNiceOperator "\<not\%( \|\>\)" conceal cchar=¬
" include the space after “not” – if present – so that “not a” becomes “¬a”.
" also, don't hide “not” behind ‘¬’ if it is after “is ”.
syntax match pyNiceOperator "\%(is \)\@<!\<not\%( \|\>\)" conceal cchar=¬
syntax match pyNiceOperator "\<not in\>" conceal cchar=
syntax match pyNiceOperator "<=" conceal cchar=
syntax match pyNiceOperator ">=" conceal cchar=
Expand Down
2 changes: 1 addition & 1 deletion conceal-test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# conceal test -- lines should match

"""
if a None: pass """
if a is not None: pass """
if a is not None: pass

"""
Expand Down

0 comments on commit b1a39eb

Please sign in to comment.