|
48 | 48 |
|
49 | 49 |
|
50 | 50 | from curtsies.configfile_keynames import keymap as key_dispatch |
51 | | -print 'hello' |
52 | 51 |
|
53 | 52 | logger = logging.getLogger(__name__) |
54 | 53 |
|
@@ -104,7 +103,7 @@ def process_event(self, e): |
104 | 103 | self.cursor_offset = 0 |
105 | 104 | self.repl.run_code_and_maybe_finish() |
106 | 105 | elif e in ("<Esc+.>",): |
107 | | - self.last_word() |
| 106 | + self.get_last_word() |
108 | 107 |
|
109 | 108 | elif e in ["<ESC>"]: |
110 | 109 | pass |
@@ -476,7 +475,7 @@ def process_key_event(self, e): |
476 | 475 | elif e in ("<Ctrl-d>",): |
477 | 476 | self.on_control_d() |
478 | 477 | elif e in ("<Esc+.>",): |
479 | | - self.last_word() |
| 478 | + self.get_last_word() |
480 | 479 | elif e in ("<Esc+r>",): |
481 | 480 | self.incremental_search(reverse=True) |
482 | 481 | elif e in ("<Esc+s>",): |
@@ -532,11 +531,18 @@ def process_key_event(self, e): |
532 | 531 | else: |
533 | 532 | self.add_normal_character(e) |
534 | 533 |
|
535 | | - def last_word(self): |
536 | | - the_history=self.rl_history.entries |
537 | | - the_line=the_history.pop() |
538 | | - the_word=the_line.split().pop() |
539 | | - self.current_line=self.current_line +the_word |
| 534 | + def get_last_word(self): |
| 535 | + last_history_entry = self.rl_history.back() |
| 536 | + print 'last_history_entry', last_history_entry |
| 537 | + # last_word = last_history_entry.split().pop() |
| 538 | + # print 'last_word', last_word |
| 539 | + |
| 540 | + # print 'first', self.cursor_offset |
| 541 | + |
| 542 | + |
| 543 | + |
| 544 | + # self._set_cursor_offset(remember_cursor_offset) |
| 545 | + # print 'second', self.cursor_offset |
540 | 546 |
|
541 | 547 | def incremental_search(self, reverse=False, include_current=False): |
542 | 548 | if self.special_mode == None: |
|
0 commit comments