#!/usr/bin/env python """emano - cut.py""" def cut(editor, append=False): if not editor.doc.selection: editor.menu.selectFrom() return if append: editor.clipboard += editor.doc.getSelection() else: editor.clipboard = editor.doc.getSelection() top, bot = editor.doc.getTopAndBot() editor.doc.delete(top, bot) (topq, topp) = top if topp > editor.maxx: editor.doc.setStartchar(topq, editor.maxx) # @@ might still need more else: editor.doc.setStartchar(topq, 0) editor.mainwin.moveTo(*top) editor.mainwin.selectTo() length = len(editor.clipboard) # @@ nice-formatting on the numbers editor.statwin.notice('Cut %s bytes to clipboard' % length) editor.doc.prevcommand = ('cut',) if __name__=="__main__": print __doc__