Skip to content

Commit

Permalink
- Fixed wrong highlighting meaning of words
Browse files Browse the repository at this point in the history
  • Loading branch information
phongvcao committed Mar 19, 2015
1 parent 3bbe8a0 commit f1c7277
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions python/stardict.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def getDefinition(argsListList, caller="vim"):
stardictWord = "\\@.*"
stardictWordType = "\\*.*"
stardictWordMeaning = "[0-9].*"
stardictWordExample = "( \\-\\s.*\\:|\\!.*)"
stardictWordExample = "( \\-\\s.*\\:|\\!.*| \\-\\s.*)"
stardictDictName = "\\@[^/]*\\:[^/]*"
# The color codes were generated by running the following commands
# in bash:
Expand Down Expand Up @@ -164,7 +164,7 @@ def getDefinition(argsListList, caller="vim"):
def formatStr(outputStr):
replacedBullet = 1
wordMeaningPattern = "^\\-\\s+.*"
wordExamplePattern = "^\\=.*"
wordExamplePattern = "^[=+].*"
wordMultiExamplesPattern = "^\\!.*"
wordPattern = "^\@.*"
dictNamePattern = "^\\-\\-\\>.*"
Expand All @@ -186,7 +186,7 @@ def formatStr(outputStr):
# this function
if (re.match(wordExamplePattern, line)):
# Re-format WordExample
replacedStr = re.sub("^\\=\\s*", " - ", line,
replacedStr = re.sub("^[=+]\\s*", " - ", line,
flags=re.IGNORECASE)
replacedStr = re.sub("\\+\\s*", ": ", replacedStr,
flags=re.IGNORECASE)
Expand Down
2 changes: 1 addition & 1 deletion syntax/stardict.vim
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ syntax match stardictResult "\v^[A-Z].*"
syntax match stardictWord "\v^\@.*"
syntax match stardictWordType "\v^\*.*"
syntax match stardictWordMeaning "\v^[0-9].*"
syntax match stardictWordExample "\v^( \-\s.*\:|\!.*)"
syntax match stardictWordExample "\v^( \-\s.*\:|\!.*| \-\s.*)"
syntax match stardictDictName "\v^\@[^/]*\:[^/]*"

highlight link stardictResult Special
Expand Down

0 comments on commit f1c7277

Please sign in to comment.