From b9ad12e6c2fa557e2c2c2f2f6c40fabc0cc89efd Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 9 May 2019 19:35:38 +0200 Subject: UI/nvim_ui_attach(): add `override` option Before now, Nvim always degrades UI capabilities to the lowest-common denominator. For example, if any connected UI has `ext_messages=false` then `ext_messages=true` requested by any other connected UI is ignored. Now `nvim_ui_attach()` supports `override=true`, which flips the behavior: if any UI requests an `ext_*` UI capability then the capability is enabled (and the legacy behavior is disabled). Legacy UIs will be broken while a `override=true` UI is connected, but it's useful for debugging: you can type into the TUI and observe the UI events from another connected (UI) client. And the legacy UI will "recover" after the `override=true` UI disconnects. Example using pynvim: >>> n.ui_attach(2048, 2048, rgb=True, override=True, ext_multigrid=True, ext_messages=True, ext_popupmenu=True) >>> while True: n.next_message(); --- src/nvim/ui.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/nvim/ui.h') diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 3f6b3babad..e1dd18a289 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -48,9 +48,11 @@ typedef int LineFlags; struct ui_t { bool rgb; + bool override; ///< Force highest-requested UI capabilities. bool composed; - bool ui_ext[kUIExtCount]; ///< Externalized widgets - int width, height; + bool ui_ext[kUIExtCount]; ///< Externalized UI capabilities. + int width; + int height; void *data; #ifdef INCLUDE_GENERATED_DECLARATIONS -- cgit