mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Highlight "$foo[1]" properly
Preserve the highlighting applied to the slice brackets when coloring variables inside of double-quoted strings.
This commit is contained in:
parent
cc49042294
commit
a24998abac
1 changed files with 5 additions and 1 deletions
|
@ -861,7 +861,11 @@ static void color_argument_internal(const wcstring &buffstr, std::vector<highlig
|
|||
*/
|
||||
case e_double_quoted:
|
||||
{
|
||||
colors[in_pos] = highlight_spec_quote;
|
||||
// slices are colored in advance, past `in_pos`, and we don't want to overwrite that
|
||||
if (colors[in_pos] == highlight_spec_param)
|
||||
{
|
||||
colors[in_pos] = highlight_spec_quote;
|
||||
}
|
||||
switch (c)
|
||||
{
|
||||
case L'"':
|
||||
|
|
Loading…
Reference in a new issue