diff --git a/mode/iperlmini.py b/mode/iperlmini.py index 716a2f9..59342d8 100644 --- a/mode/iperlmini.py +++ b/mode/iperlmini.py @@ -18,7 +18,7 @@ class IperlExec(method.Method): w.mode.hindex = len(w.mode.history) - 1 a = w.application - b = w.mode._get_iperl() + b = w.mode.get_iperl() if a.window().buffer is not b: a.switch_buffer(b) p = a.get_mini_buffer_prompt() @@ -33,7 +33,7 @@ class IperlTab(method.Method): def execute(self, w, **vargs): a = w.application s = w.buffer.make_string() - b = w.mode._get_iperl() + b = w.mode.get_iperl() x2 = w.logical_cursor().x if not s or s[:x2].isspace(): @@ -103,7 +103,7 @@ class IperlMini(mode.Fundamental): IperlPageUp, IperlPageDown, IperlGotoBeginning, IperlGotoEnd] readre = re.compile('^([A-Z]+):(.*)\n$') def _readline(self): - b = self._get_iperl() + b = self.get_iperl() line = b.pipe.stdout.readline() m = self.readre.match(line) if m: @@ -111,7 +111,7 @@ class IperlMini(mode.Fundamental): else: return ('RAW', line.rstrip()) def _read(self): - b = self._get_iperl() + b = self.get_iperl() output = [] while True: (type_, value) = self._readline() @@ -127,21 +127,14 @@ class IperlMini(mode.Fundamental): else: return '' - def _get_iperl(self): - a = self.window.application - if not a.has_buffer_name('*IPerl*'): - b = buffer.IperlBuffer(None) - a.add_buffer(b) - window.Window(b, a) - else: - b = a.bufferlist.get_buffer_by_name('*IPerl*') - return b + def get_iperl(self): + return self.window.buffer.method.main_buffer def __init__(self, w): mode.Fundamental.__init__(self, w) self.history = [''] self.hindex = 0 - b = self._get_iperl() + b = self.get_iperl() w.application.set_mini_buffer_prompt(b.prompt) self.add_bindings('iperl-exec', ('RETURN',)) self.add_bindings('console-clear', ('C-l',))