mirror of
https://github.com/wassname/pyreadline.git
synced 2026-08-04 13:13:32 +08:00
Merging tab-emulation from trunk
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2008-08-25 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu>
|
||||
* Merging tab insert patch from Vivian De Smedt. Removed comments
|
||||
with vds initials.
|
||||
|
||||
2008-02-21 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu>
|
||||
* unicodehelper functions now defaults to ascii if supplied pyreadline_encoding is
|
||||
not a valid encoding. This is a brute force solution to ticket #228 it fixes
|
||||
|
||||
@@ -347,7 +347,8 @@ class EmacsMode(DigitArgumentMode, IncrementalSearchPromptMode, SearchPromptMode
|
||||
|
||||
def tab_insert(self, e): # (M-TAB)
|
||||
'''Insert a tab character. '''
|
||||
ws = ' ' * (self.tabstop - (self.l_buffer.point%self.tabstop))
|
||||
cursor = min(self.l_buffer.point, len(self.l_buffer.line_buffer))
|
||||
ws = ' ' * (self.tabstop - (cursor % self.tabstop))
|
||||
self.insert_text(ws)
|
||||
self.finalize()
|
||||
|
||||
|
||||
@@ -272,7 +272,8 @@ class NotEmacsMode(basemode.BaseMode):
|
||||
|
||||
def tab_insert(self, e): # (M-TAB)
|
||||
'''Insert a tab character. '''
|
||||
ws = ' ' * (self.tabstop - (self.line_cursor%self.tabstop))
|
||||
cursor = min(self.l_buffer.point, len(self.l_buffer.line_buffer))
|
||||
ws = ' ' * (self.tabstop - (cursor % self.tabstop))
|
||||
self.insert_text(ws)
|
||||
|
||||
def self_insert(self, e): # (a, b, A, 1, !, ...)
|
||||
|
||||
Reference in New Issue
Block a user