From 022459f0c0a30bb80b4911691cb608829826c239 Mon Sep 17 00:00:00 2001 From: cosven Date: Sun, 30 Sep 2018 12:08:38 +0800 Subject: [PATCH] adapt to prompt_toolkit 2.0 return application current buffer as editor current_buffer --- pyvim/editor.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pyvim/editor.py b/pyvim/editor.py index 3dcdd8c..a0d4864 100644 --- a/pyvim/editor.py +++ b/pyvim/editor.py @@ -190,13 +190,7 @@ def current_editor_buffer(self): """ Return the `EditorBuffer` that is currently active. """ - # For each buffer name on the focus stack. - for current_buffer_name in self.application.buffers.focus_stack: - if current_buffer_name is not None: - # Find/return the EditorBuffer with this name. - for b in self.window_arrangement.editor_buffers: - if b.buffer_name == current_buffer_name: - return b + return self.application.current_buffer @property def add_key_binding(self):