Skip to content

Commit 1928ad2

Browse files
Revert "Fix Editor.current_editor buffer (for prompt_toolkit 2.0)."
This reverts commit 573c064.
1 parent 573c064 commit 1928ad2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pyvim/editor.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,13 @@ def current_editor_buffer(self):
191191
"""
192192
Return the `EditorBuffer` that is currently active.
193193
"""
194-
return self.application.current_buffer
194+
# For each buffer name on the focus stack.
195+
for current_buffer_name in self.application.buffers.focus_stack:
196+
if current_buffer_name is not None:
197+
# Find/return the EditorBuffer with this name.
198+
for b in self.window_arrangement.editor_buffers:
199+
if b.buffer_name == current_buffer_name:
200+
return b
195201

196202
@property
197203
def add_key_binding(self):

0 commit comments

Comments
 (0)