I have a custom syntax with the following minimal example:
contexts:
main:
- match: '^↓$'
set: highlight
highlight:
- match: '^$'
pop: true
Basically, my entire file is split into blocks separated by empty lines, some of which are prefaced by a line with only “↓” on it, which marks that this block is “highlighted”. The file is fairly large, 250k lines and 25m characters.
When I was on ST3, everything was working smoothly. When I upgraded to ST4, making or deleting new lines and writing/erasing the first/only character in them at the start of* large highlight blocks started being accompanied by a several-second delay.
(*by “at the start” I really mean that the lag is most severe at the start and then gradually diminishes the lower you go and the fewer lines remain to the end of the block)
To reproduce:
- Use the syntax above.
- Create a new file that is nothing but 200k lines of 100 characters each.
- Add a line with only “↓” right before this chunk of text.
- Press enter after the “↓” (or at the end of any line at the start of the large block, so a new empty line is created)
- Result: a long lag.
- Type any symbol.
- Result: another long lag.