summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-09-16 20:19:31 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-09-16 20:19:31 +0000
commitc5366491124d138df0d74e98c1282d7e58e159b8 (patch)
treed26eb7abc903f92563bc8aed18a4bb7af98b37a0
parentf638427afc92dda86452e563524d5528fee2b344 (diff)
downloadpoezio-c5366491124d138df0d74e98c1282d7e58e159b8.tar.gz
poezio-c5366491124d138df0d74e98c1282d7e58e159b8.tar.bz2
poezio-c5366491124d138df0d74e98c1282d7e58e159b8.tar.xz
poezio-c5366491124d138df0d74e98c1282d7e58e159b8.zip
fix the shlex fail. Colors are disabled on too long elements
-rw-r--r--src/window.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/window.py b/src/window.py
index e92fdc5b..162d10f7 100644
--- a/src/window.py
+++ b/src/window.py
@@ -439,9 +439,11 @@ class TextWin(Win):
try:
splitted = shlex.split(txt)
except ValueError:
- from common import debug
- debug('SHLEX FAILED on: [%s]\n' % (txt,))
- splitted = 'shlex failed here. See debug'.split()
+ # FIXME colors are disabled on too long words
+ txt = txt.replace('"[', '').replace(']"', '')\
+ .replace('"{', '').replace('}"', '')\
+ .replace('"(', '').replace(')"', '')
+ splitted = txt.split()
for word in splitted:
if word in list(special_words.keys()):
self.addstr(word, curses.color_pair(special_words[word]))