From b50acaae0b4499aec0d06f91739d23e6aa212156 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 9 Oct 2012 06:00:43 +0000 Subject: Send a real \t when pasting a text containing tabs. --- src/windows.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/windows.py') 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)) -- cgit v1.2.3