diff --git a/mode/shellmini.py b/mode/shellmini.py index b28ea35..b1f3858 100644 --- a/mode/shellmini.py +++ b/mode/shellmini.py @@ -6,8 +6,6 @@ from point import Point from method import Method from subprocess import Popen, PIPE, STDOUT -#PAD = ' ' -PAD = '' LIMIT = 79 class ShellExec(Method): @@ -54,10 +52,9 @@ class ShellExec(Method): if escaped: escaped.append(c) if c == 'm': - seq = ''.join(escaped) - if seq in self.sequences: - #output2.append(self.sequences[seq]) - pass + #seq = ''.join(escaped) + #if seq in self.sequences: + # output2.append(self.sequences[seq]) escaped = [] elif c == '\x1b': escaped.append(c) @@ -84,7 +81,6 @@ class ShellExec(Method): limit = min(w.width, limit) if limit == 1000: limit = LIMIT - limit -= len(PAD) if output: newlines = [] @@ -93,19 +89,19 @@ class ShellExec(Method): line = line.replace('\x1b[01;34m', "[blue:default]") line = line.replace('\x1b[01;36m', "[cyan:default]") line = line.replace('\x1b[0m', "[default:default]") - #line = repr(line) + i = 0 while i + limit < len(line): j = limit while j > 0 and line[i + j] != ' ': j -= 1 if j == 0: - newlines.append(PAD + line[i:i + limit]) - i += j + newlines.append(line[i:i + limit]) + i += limit else: - newlines.append(PAD + line[i:i + j]) + newlines.append(line[i:i + j]) i += j + 1 - newlines.append(PAD + line[i:]) + newlines.append(line[i:]) newlines[-1] = '' b.insert_lines(b.get_buffer_end(), newlines, force=True) for w2 in b.windows: