Changeset 2340

Show
Ignore:
Timestamp:
05/14/07 15:18:43 (2 years ago)
Author:
jstenar
Message:

pyreadline: fix pageup, pagedown scrolling of window. Started work on implementing kill_ring separate from clipboard. ctrl-k and esc no longer puts anything on clipboard

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pyreadline/trunk/doc/ChangeLog

    r2339 r2340  
     12007-05-14 Jörgen Stenarson  <jorgen.stenarson -at- bostream.nu> 
     2    * Fixing pageup pagedown scrolling of window 
     3    * Begining work on killring. ctrl-k ctrl-y will not use clipboard anymore 
     4 
    152007-05-14 Jörgen Stenarson  <jorgen.stenarson -at- bostream.nu> 
    26    * pre_inputhook and startup_hook were not functioning properly. 
  • pyreadline/trunk/pyreadline/configuration/pyreadlineconfig.ini

    r2246 r2340  
    6565 
    6666bind_key("Control-v",           "paste") 
    67 bind_key("Control-y",           "paste") 
     67bind_key("Control-y",           "yank") 
    6868bind_key("Alt-v",               "ipython_paste") 
    6969 
  • pyreadline/trunk/pyreadline/console/console.py

    r2246 r2340  
    508508            if e.type == 'KeyPress' and e.keycode not in key_modifiers: 
    509509                log(e) 
    510                 if e.keysym == 'Next': 
     510                if e.keyinfo.keyname == 'next': 
    511511                    self.scroll_window(12) 
    512                 elif e.keysym == 'Prior': 
     512                elif e.keyinfo.keyname == 'prior': 
    513513                    self.scroll_window(-12) 
    514514                else: 
  • pyreadline/trunk/pyreadline/lineeditor/lineobj.py

    r1834 r2340  
    393393        self.selection_mark=-1 
    394394        self.enable_selection=True 
    395  
     395        self.kill_ring=[] 
    396396    def __repr__(self): 
    397397        return 'ReadLineTextBuffer("%s",point=%s,mark=%s,selection_mark=%s)'%(self.line_buffer,self.point,self.mark,self.selection_mark) 
     
    635635 
    636636    def kill_line(self): 
    637         self[self.point:].to_clipboard() 
     637        #self[self.point:].to_clipboard() 
     638        self.add_to_kill_ring(self[self.point:]) 
    638639        del self.line_buffer[self.point:] 
    639640     
    640641    def kill_whole_line(self): 
    641         self[:].to_clipboard() 
     642        #self[:].to_clipboard() 
     643        self.add_to_kill_ring(self[:]) 
    642644        del self[:] 
    643645     
    644646    def backward_kill_line(self): 
    645         self[StartOfLine:Point].to_clipboard() 
     647        #self[StartOfLine:Point].to_clipboard() 
    646648        del self[StartOfLine:Point] 
    647649         
     
    652654    def kill_word(self): 
    653655        """Kills to next word ending""" 
    654         self[Point:NextWordEnd].to_clipboard() 
     656        #self[Point:NextWordEnd].to_clipboard() 
    655657        del self[Point:NextWordEnd] 
    656658 
    657659    def backward_kill_word(self): 
    658660        """Kills to next word ending""" 
    659         self[PrevWordStart:Point].to_clipboard() 
     661        #self[PrevWordStart:Point].to_clipboard() 
    660662        if not self.delete_selection(): 
    661663            del self[PrevWordStart:Point] 
     
    664666    def forward_kill_word(self): 
    665667        """Kills to next word ending""" 
    666         self[Point:NextWordEnd].to_clipboard() 
     668        #self[Point:NextWordEnd].to_clipboard() 
    667669        if not self.delete_selection(): 
    668670            del self[Point:NextWordEnd] 
     
    670672 
    671673    def unix_word_rubout(self): 
    672         self[PrevSpace:Point].to_clipboard() 
    673674        if not self.delete_selection(): 
    674675            del self[PrevSpace:Point] 
     
    689690 
    690691    def yank(self): 
    691         pass 
     692        self.paste_from_kill_ring() 
    692693 
    693694    def yank_pop(self): 
    694695        pass 
    695  
    696696 
    697697##############  Mark  
     
    735735 
    736736 
     737############## Kill ring 
     738    def add_to_kill_ring(self,txt): 
     739        self.kill_ring=[txt] 
     740         
     741 
     742    def paste_from_kill_ring(self): 
     743        if self.kill_ring: 
     744            self.insert_text(self.kill_ring[0]) 
     745 
     746 
    737747################################################################## 
    738748q=ReadLineTextBuffer("asff asFArw  ewrWErhg",point=8) 
  • pyreadline/trunk/pyreadline/modes/emacs.py

    r2246 r2340  
    366366    def yank(self, e): # (C-y) 
    367367        '''Yank the top of the kill ring into the buffer at point. ''' 
    368         pass 
     368        self.l_buffer.yank() 
    369369 
    370370    def yank_pop(self, e): # (M-y) 
    371371        '''Rotate the kill-ring, and yank the new top. You can only do this 
    372372        if the prior command is yank or yank-pop.''' 
    373         pass 
     373        self.l_buffer.yank_pop() 
    374374 
    375375 
     
    581581        self._bind_key('Control-v',         self.paste) 
    582582        self._bind_key('Alt-v',             self.ipython_paste) 
    583         self._bind_key('Control-y',         self.paste
     583        self._bind_key('Control-y',         self.yank
    584584        self._bind_key('Control-k',         self.kill_line) 
    585585        self._bind_key('Control-m',         self.set_mark)