Merging tab-emulation from trunk

This commit is contained in:
Jorgen Stenarson
2008-08-27 19:40:12 +02:00
3 changed files with 8 additions and 2 deletions
+4
View File
@@ -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
+2 -1
View File
@@ -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()
+2 -1
View File
@@ -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, !, ...)