Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # atom
- # stop ctrl-c on from wiping out what uyou have in the clipboard
- # prevent core:copy if and only if there's one selection in
- # the active editor (mini or not) and its length equals 0
- atom.commands.add 'atom-text-editor', 'core:copy', (e) ->
- editor = e.currentTarget.getModel()
- # do nothing if there's more than 1 selection
- return if editor.getSelectedBufferRanges().length > 1
- # get the starting and ending points of the selection
- {start, end} = editor.getSelectedBufferRange()
- # stop the command from immediate propagation (i.e.
- # executing the same command on the same element or
- # an element higher up the DOM tree). This works
- # because atom executes commands in the reverse order
- # they were registered with atom.commands.add, and this
- # one's added after the core commands are already
- # registered.
- if start.column is end.column and start.row is end.row
- e.stopImmediatePropagation()
Add Comment
Please, Sign In to add comment