How to block a command?


I have a type of editor tab that I don’t want to be able to split. Having two of this type is illogical and troublesome.

Can I block the split commands just when this type (class) of editor is showing?


Does the split method trigger any before/after events by any chance? The Dev console should help there, although I haven’t tried using the events panel.


It turned out to be easy. I did not realize commands were simply jquery events.

splitCommand = (e) =>
    message: 'Notice:\n'
    detailedMessage: 'You may not split a history view.'
    buttons: ['OK']

@editorView.on 'pane:split-left',  splitCommand
@editorView.on 'pane:split-right', splitCommand
@editorView.on 'pane:split-up',    splitCommand
@editorView.on 'pane:split-down',  splitCommand

It doesn’t even show up in ctrl-shift-P and ctrl-K-up gives my message and blocks it.