z-shell / F-Sy-H

⚙️ Feature-rich Syntax Highlighting for Zsh
https://wiki.zshell.dev/search?q=F-Sy-H
BSD 3-Clause "New" or "Revised" License
165 stars 24 forks source link

Cannot Properly parse aliased ] #20

Closed tusooa closed 2 years ago

tusooa commented 2 years ago

aliased $ is correctly parsed as an alias, but aliased ] is parsed as "unexpected symbol." image the ]s at the beginning of the line are my prompts.

ss-o commented 2 years ago

Hey @tusooa:wave:

Could you provide more details about the system and your .zshrc to reproduce the issue? :octocat:

e.g: echo "OSTYPE=${OSTYPE} CPUTYPE=$(uname -m) / MACHINE_TYPE=$MACHTYPE ZSH_VERSION=${ZSH_VERSION}"

ss-o commented 2 years ago

@tusooa,

Additionally, now you can set up tests for any plugin. Check https://github.com/z-shell/z-a-test.

tusooa commented 2 years ago

Hey @tusooawave Could you provide more details about the system and your .zshrc to reproduce the issue? :octocat:

e.g: echo "OSTYPE=${OSTYPE} CPUTYPE=$(uname -m) / MACHINE_TYPE=$MACHTYPE ZSH_VERSION=${ZSH_VERSION}"

OSTYPE=linux-gnu CPUTYPE=x86_64 / MACHINE_TYPE=x86_64 ZSH_VERSION=5.8.1

https://lily.kazv.moe/tusooa/apps/-/blob/servant/Config/zshrc

or rather, use a user without any zshrc and do the following

tusooa-yoga% cd
tusooa-yoga% . ./F-Sy-H/fast-syntax-highlighting.plugin.zsh
tusooa-yoga% alias ']'=''
tusooa-yoga% alias '$'=''
tusooa-yoga% ] ls
tusooa-yoga% $ ls
ss-o commented 2 years ago

asciicast

ss-o commented 2 years ago

https://github.com/z-shell/community/blob/main/docs/zi-asciinema/INSTALL.md To share terminal recordings.

ss-o commented 2 years ago

Option 1

Create a folder name: tusooa Put your config and we will test it in the container. :octocat: :upside_down_face:

https://github.com/z-shell/playground/

Option 2

Or try your config in the ZI container:

docker run -it ghcr.io/z-shell/zd:latest https://github.com/z-shell/zd/pkgs/container/zd/18549345?tag=latest

tusooa commented 2 years ago

Option 1

Create a folder name: tusooa Put your config and we will test it in the container. :octocat: upside_down_face

https://github.com/z-shell/playground/

Option 2

Or try your config in the ZI container:

docker run -it ghcr.io/z-shell/zd:latest https://github.com/z-shell/zd/pkgs/container/zd/18549345?tag=latest

https://user-images.githubusercontent.com/299873/162502225-12261797-947b-4629-88e5-8e2cd7bb45e1.mp4

ss-o commented 2 years ago

Nope, not here https://github.com/z-shell/F-Sy-H/blob/3b654bbd3c973216c22878ac716595d6428f0d5c/fast-highlight#L295

Still have a few alternatives to check. so will update you on this. :ballot_box_with_check:

ss-o commented 2 years ago

@tusooa, it seems you are unable to alias [ ], due to conflict with the bracket highlighter: https://github.com/z-shell/F-Sy-H/blob/3b654bbd3c973216c22878ac716595d6428f0d5c/fast-highlight#L168

This should solve the issue:

export FAST_HIGHLIGHT[use_brackets]=0
tusooa commented 2 years ago

Ok.