sure, (using 0.92.0 btw), it’s not very involved. this is in a cson file under the
and this is in the ‘main’ package coffee file under
activate: (state) ->
atom.workspaceView.command 'context-ccp:cut', '.editor', ->
editor = atom.workspace.getActiveEditor()
console.log 'ccp.cut: text=%s', editor.getSelection().getText()
log msg shows
getText() returning an empty string…
also, experimenting with the call to
core:cut seems to show that the current selection turns into a single spot where the right-click occurred to pop the context menu (it cuts a single character at that spot).
i was trying to figure out a way to get a callback before the context menu pops so i could stash away the current selection somewhere, but i couldn’t figure out how (perhaps some ‘on’ call?). ideally tho, perhaps the core code could preserve it…?