From ff4d402e9a587e0e8f8400a3aeac40a8f73215e5 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 28 Jan 2015 13:28:09 +0000 Subject: [PATCH] Highlight the first part of multiline strings correctly Given the following input: PREBUFFER=$'echo "foo\n' BUFFER='bar"' This patch causes the '"foo' part to be highlighted as a string. There is no test because the tests only check highlighting of BUFFER, and 'bar"' is already highlighted correctly. --- highlighters/main/main-highlighter.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 657fcd3..2c9120a 100755 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -177,13 +177,13 @@ _zsh_highlight_main_highlighter() case $arg in '--'*) style=$ZSH_HIGHLIGHT_STYLES[double-hyphen-option];; '-'*) style=$ZSH_HIGHLIGHT_STYLES[single-hyphen-option];; - "'"*"'") style=$ZSH_HIGHLIGHT_STYLES[single-quoted-argument];; - '"'*'"') style=$ZSH_HIGHLIGHT_STYLES[double-quoted-argument] + "'"*) style=$ZSH_HIGHLIGHT_STYLES[single-quoted-argument];; + '"'*) style=$ZSH_HIGHLIGHT_STYLES[double-quoted-argument] _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style _zsh_highlight_main_highlighter_highlight_string substr_color=1 ;; - '`'*'`') style=$ZSH_HIGHLIGHT_STYLES[back-quoted-argument];; + '`'*) style=$ZSH_HIGHLIGHT_STYLES[back-quoted-argument];; *"*"*) $highlight_glob && style=$ZSH_HIGHLIGHT_STYLES[globbing] || style=$ZSH_HIGHLIGHT_STYLES[default];; *) if _zsh_highlight_main_highlighter_check_path; then style=$ZSH_HIGHLIGHT_STYLES[path]