mirror of
https://github.com/wassname/pyreadline.git
synced 2026-07-18 12:40:38 +08:00
Merging patch from Vivian De Smedt for tab insert, removed comments with vds initials
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
|
||||
|
||||
@@ -25,6 +25,7 @@ class BaseMode(object):
|
||||
self.key_dispatch = {}
|
||||
self.argument=1
|
||||
self.prevargument=None
|
||||
self.tabstop = 4
|
||||
|
||||
def __repr__(self):
|
||||
return "<BaseMode>"
|
||||
|
||||
@@ -283,7 +283,8 @@ class EmacsMode(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 transpose_chars(self, e): # (C-t)
|
||||
|
||||
@@ -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