diff options
author | Florent Le Coz <louiz@louiz.org> | 2012-10-09 06:00:43 +0000 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-10-09 06:00:43 +0000 |
commit | b50acaae0b4499aec0d06f91739d23e6aa212156 (patch) | |
tree | 3569ee25769679ef871b0a39a870d049bae7b27c /src/windows.py | |
parent | c9a244ceb02ae0fe6710ddb08f573deb6b0bbd3b (diff) | |
download | poezio-b50acaae0b4499aec0d06f91739d23e6aa212156.tar.gz poezio-b50acaae0b4499aec0d06f91739d23e6aa212156.tar.bz2 poezio-b50acaae0b4499aec0d06f91739d23e6aa212156.tar.xz poezio-b50acaae0b4499aec0d06f91739d23e6aa212156.zip |
Send a real \t when pasting a text containing tabs.
Diffstat (limited to 'src/windows.py')
-rw-r--r-- | src/windows.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/windows.py b/src/windows.py index a8af3b7f..cf341e28 100644 --- a/src/windows.py +++ b/src/windows.py @@ -1380,7 +1380,12 @@ class MessageInput(Input): Refresh the line onscreen, from the pos and pos_line, with colors """ with g_lock: - text = self.text.replace('\n', '|') + # Replace \t with ' ' just to make the input easily editable. + # That's not perfect, because we cannot differenciate a tab and + # a space. But at least it makes it possible to paste text + # containing a tab by sending a real tab, not just four spaces + # while still being able to edit the input in that case. + text = self.text.replace('\n', '|').replace('\t', ' ') self._win.erase() if self.color: self._win.attron(to_curses_attr(self.color)) |