martanne / vis

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

lexers: fix bug in bash lexer for last here-doc #905

Closed silasdb closed 3 years ago

silasdb commented 3 years ago

f4f0f5b allowed "<<-EOF" heredocs to be parsed correctly, but it introduced a bug that made the lexer fail when the beginning of a here-doc was the last string in a file (optionally followed only by blanks).

In order to fix this, move everything regarding "delimiter" within the block that is executed only if "delimiter" is not nil.