zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.39k stars 1.16k forks source link

action: Stop processing chained actions/commands in the moment the current `Pane` is not a `BufPane` (fix crash) #3261

Closed JoeKar closed 2 months ago

JoeKar commented 2 months ago

Actually the TermPane isn't really considered as a Pane, even it really is a Pane. -> In the first version of this PR I added the Name() function to the TermPane to be able to consider the TermPane as a Pane in the future.

The main change to fix the crash is the check the return of MainTab().CurPane() against nil in the BufMapEvent() respective bufAction() function, because CurPane() will return it in the moment the current pane changes to a pane other than a BufPane.

Fixes #2288 Fixes #2307