diff --git a/pyvim/editor.py b/pyvim/editor.py index 78c5bff..0fd748f 100644 --- a/pyvim/editor.py +++ b/pyvim/editor.py @@ -191,7 +191,13 @@ def current_editor_buffer(self): """ Return the `EditorBuffer` that is currently active. """ - return self.application.current_buffer + # 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 @property def add_key_binding(self):