On macOS, next and previous tab for documents/tabs within applications are bound to Cmd-Shift-[ and Cmd-Shift-]. Pressing these while in the editor changes tabs but invokes the delimiter insertion code leaving behind unwanted delimiters when coming back to the editor.
Solution:
Only run the delimiter handling code if the Cmd button is not pressed. This is detectable via use of the meta key in the browser.
Problem:
On macOS, next and previous tab for documents/tabs within applications are bound to Cmd-Shift-[ and Cmd-Shift-]. Pressing these while in the editor changes tabs but invokes the delimiter insertion code leaving behind unwanted delimiters when coming back to the editor.
Solution:
Only run the delimiter handling code if the
Cmd
button is not pressed. This is detectable via use of themeta
key in the browser.