Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Commit ff3ccc7

Browse files
committed
allow NVIM_PYTHON_UI_DEBUG_EXT=ext_cmdline,ext_tabline for quick debugging
1 parent 7952cdf commit ff3ccc7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

neovim_gui/gtk_ui.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Neovim Gtk+ UI."""
22
from __future__ import print_function, division
33
import math
4+
import os
45

56
import cairo
67

@@ -95,7 +96,9 @@ def __init__(self, font):
9596

9697
def start(self, bridge):
9798
"""Start the UI event loop."""
98-
bridge.attach(80, 24, rgb=True)
99+
debug_ext_env = os.environ.get("NVIM_PYTHON_UI_DEBUG_EXT", "")
100+
extra_exts = {x:True for x in debug_ext_env.split(",") if x}
101+
bridge.attach(80, 24, rgb=True, **extra_exts)
99102
drawing_area = Gtk.DrawingArea()
100103
drawing_area.connect('draw', self._gtk_draw)
101104
window = Gtk.Window()

neovim_gui/ui_bridge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ def connect(self, nvim, ui, profile=None, notify=False):
2323
self._profile = profile
2424
self._sem = Semaphore(0)
2525
debug_env = os.environ.get("NVIM_PYTHON_UI_DEBUG", "")
26+
debug_ext_env = os.environ.get("NVIM_PYTHON_UI_DEBUG_EXT", "")
27+
self.debug_ext = len(debug_ext_env) > 0
2628
if debug_env == "2":
2729
self.debug_events = 2
2830
else:
29-
self.debug_events = len(debug_env) > 0
31+
self.debug_events = len(debug_env) > 0 or self.debug_ext
3032
t = Thread(target=self._nvim_event_loop)
3133
t.daemon = True
3234
t.start()
@@ -107,7 +109,7 @@ def apply_updates():
107109
print(repr(update), file=sys.stdout)
108110
for args in update[1:]:
109111
handler(*args[:nparam])
110-
if self.debug_events == 2:
112+
if self.debug_events == 2 or self.debug_ext:
111113
print("<flush>")
112114
except Exception:
113115
self._error = format_exc()

0 commit comments

Comments
 (0)