Skip to content

broken high lighting #151

Closed
Closed

Description

@palandovalex

Problem description
Just see this code fragment:

Снимок экрана от 2023-03-07 18-31-10

Affected language servers

bash

Steps to reproduce

use such bash code fragment, and you will see it

case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

Actual behavior

syntax highlighting breaks down on the case language construct

Expected behavior

normal highlighting, NOT WORSE THAN WITH pure neovim!

Activity

  1. verhovsky commented on Mar 8, 2023

    @verhovsky
    Collaborator

    Pasting this into https://tree-sitter.github.io/tree-sitter/playground it's parsed correctly, so it seems like this has been fixed on master but not released yet, just like #148

  2. Exlll commented on Jun 16, 2023

    @Exlll

    This seems to be caused by the ( and ) after the + in that line. If I remove the braces (or replace them with square brackets), the rest is highlighted correctly, e.g.:

    # PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 
    PS1="\[\e]0;${debian_chroot:+$debian_chroot}\u@\h: \w\a\]$PS1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions