Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/re-enable quoted_insert: use self.evt.data #17

Merged
merged 2 commits into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pyrepl/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,12 @@ def do(self):

class qIHelp(Command):
def do(self):
from .reader import disp_str

r = self.reader
r.insert((bytes(self.event) + r.console.getpending().data) * r.get_arg())
pending = r.console.getpending().data
disp = disp_str((self.event + pending))[0]
r.insert(disp * r.get_arg())
r.pop_input_trans()

from pyrepl import input
Expand All @@ -379,7 +383,7 @@ class QITrans(object):
def push(self, evt):
self.evt = evt
def get(self):
return ('qIHelp', self.evt.raw)
return ('qIHelp', self.evt.data)

class quoted_insert(Command):
kills_digit_arg = 0
Expand Down
4 changes: 4 additions & 0 deletions testing/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def get_event(self, block=1):
print("event", ev)
return Event(*ev)

def getpending(self):
"""Nothing pending, but do not return None here."""
return Event('key', '', b'')


class TestReader(Reader):
__test__ = False
Expand Down
2 changes: 1 addition & 1 deletion testing/test_wishes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def test_quoted_insert_repeat():
read_spec([
(('digit-arg', '3'), ['']),
(('quoted-insert', None), ['']),
(('self-insert', '\033'), ['^[^[^[']),
(('key', '\033'), ['^[^[^[']),
(('accept', None), None)])