martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.25k stars 258 forks source link

Bash lexer crashes when end tag of here document is off-screen #1008

Closed dragonmaus closed 1 year ago

dragonmaus commented 2 years ago

If a bash script contains a here document that is only partially on-screen (that is, the start [the bit with << or <<-] is visible but the end is not), the lexer will crash with the following error:

/path/to/vis/lexers/bash.lua:<linenumber>: attempt to concatenate a nil value (local 'delimiter')

This crash is persistent, and will reoccur every time vis tries to render the partially off-screen here document.

(The inverse is not true; that is, the lexer will not crash if the end tag is visible but the start is not.)


Vis version: vis v0.7 +curses +lua +acl

ninewise commented 2 years ago

IIRC this was a bug in the bash lexer and I believe I've seen a fix for this pass by at scintillua.

OK found it: https://github.com/orbitalquark/scintillua/pull/43