When testing the context menu fixes, I noticed that I wasn't able to display the right-click menu in Safari, though it worked in Electron and other browsers. It would flicker for a moment and then vanish again.
I don't have a real mouse and use ctrl+tap on my trackpad to right click. It turns out that this does not create a "true" right click event, and was therefore being erroneously picked up by the click and mousedown handlers.
In the process of fixing this I found a few opportunities to clean up the padding, though there is sadly no official way to add left/right padding via Monaco. I also tested and fixed the word-wrap setting in Safari in a separate PR, #3191 .
Test
In multiple browsers and on Electron:
Click in various places on the editor and verify that it focuses the text editor.
Right-click (with various mice if possible?) and verify that the context menu is shown appropriately.
n.b. We do not show the context menu after a right-click on the left gutter, because we are tricking Monaco into putting padding there by abusing the lineDecorationsWidth option.
Fix
When testing the context menu fixes, I noticed that I wasn't able to display the right-click menu in Safari, though it worked in Electron and other browsers. It would flicker for a moment and then vanish again.
I don't have a real mouse and use ctrl+tap on my trackpad to right click. It turns out that this does not create a "true" right click event, and was therefore being erroneously picked up by the click and mousedown handlers.
In the process of fixing this I found a few opportunities to clean up the padding, though there is sadly no official way to add left/right padding via Monaco. I also tested and fixed the word-wrap setting in Safari in a separate PR, #3191 .
Test
In multiple browsers and on Electron:
n.b. We do not show the context menu after a right-click on the left gutter, because we are tricking Monaco into putting padding there by abusing the lineDecorationsWidth option.