moemoechu / tabby-highlight

Tabby Highlight Plugin
32 stars 1 forks source link

Regex alternate screen garbled #4

Closed eugenov closed 11 months ago

eugenov commented 11 months ago

Alternate screens shows garbage symbols for some expressions that use "+" or "*" symbols, i.e.

'(.|\r|\n)*?'|"(.|\r|\n)*?"|`(.|\r|\n)*?`

(everything in quotes) or

\$\b([_a-zA-Z0-9]+)\b

(every word starting with $) Is there any workaround for this? Example:

eugenov commented 11 months ago

same with "less" seams OK

moemoechu commented 11 months ago

Just release 1.2.0, found no problem, maybe you can try it. image image

eugenov commented 11 months ago

Confirmed, this single line does look good in vim. When in 100-line script - does not. Researching now. UPD2: full script with nano also seems better (but not perfect). UPD3: :syntax off makes file look good, but it garbles as cursor moves What realization of regex do you use?

moemoechu commented 11 months ago

I found there are some rare situation, the terminal will get mess by placeholder string, I made some fix in next release, maybe version 1.2.4 at tomorrow.

eugenov commented 11 months ago

Tested 1.2.4 - perfect, garbage symbols CCCOOONNN_SSSEEEQQQ____CCCOOONNN_SSSEEEQQQ gone! Thank you for finding such quick solution! Still left some rare issues, but I believe it is because of faulty expression

eugenov commented 11 months ago

If you want to elaborate - #.* (everything after #) replaced with [?12l[?25h with screen redraw when scrolling. I.e. When you open file with #!/bin/bash as header, you see #!/bin/bash, but if you scroll away and then return to this line - it will look like [?12l[?25hh Ah, will leave issue open, if you don't mind. Just to remember... UPD: this happens only when you scroll with mouse wheel. If you scroll with keyboard - everything is fine.

moemoechu commented 11 months ago

released 1.2.5,may fix this.

If you want to elaborate - #.* (everything after #) replaced with [?12l[?25h with screen redraw when scrolling. I.e. When you open file with #!/bin/bash as header, you see #!/bin/bash, but if you scroll away and then return to this line - it will look like [?12l[?25hh Ah, will leave issue open, if you don't mind. Just to remember... UPD: this happens only when you scroll with mouse wheel. If you scroll with keyboard - everything is fine.

eugenov commented 11 months ago

Yep, right now don't see any problems regarding this issue. Thank you!