Skip to content

Commit 98366ae

Browse files
author
Steph Samson
committed
getting somewhere... I think
1 parent 343cc91 commit 98366ae

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848

4949

5050
from curtsies.configfile_keynames import keymap as key_dispatch
51-
print 'hello'
5251

5352
logger = logging.getLogger(__name__)
5453

@@ -104,7 +103,7 @@ def process_event(self, e):
104103
self.cursor_offset = 0
105104
self.repl.run_code_and_maybe_finish()
106105
elif e in ("<Esc+.>",):
107-
self.last_word()
106+
self.get_last_word()
108107

109108
elif e in ["<ESC>"]:
110109
pass
@@ -476,7 +475,7 @@ def process_key_event(self, e):
476475
elif e in ("<Ctrl-d>",):
477476
self.on_control_d()
478477
elif e in ("<Esc+.>",):
479-
self.last_word()
478+
self.get_last_word()
480479
elif e in ("<Esc+r>",):
481480
self.incremental_search(reverse=True)
482481
elif e in ("<Esc+s>",):
@@ -532,11 +531,18 @@ def process_key_event(self, e):
532531
else:
533532
self.add_normal_character(e)
534533

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
540546

541547
def incremental_search(self, reverse=False, include_current=False):
542548
if self.special_mode == None:

0 commit comments

Comments
 (0)