fix(log): unify error messages for vim.ui_attach/decor providers #33005

Problem:  Error messages that cause a vim.ui_attach() namespace to
          detach are not visible in the message history. Decoration
          provider and vim.ui_attach error messages are dissimilar.
Solution: Emit vim.ui_attach() errors as an actual message in addition
          to logging it. Adjust error message format.
This commit is contained in:
luukvbaal
2025-03-21 11:05:01 +01:00
committed by GitHub
parent fa85543e3b
commit c908c2560d
5 changed files with 97 additions and 70 deletions

View File

@@ -44,6 +44,9 @@ typedef enum {
kRetLuaref, ///< return value becomes a single Luaref, regardless of type (except NIL)
} LuaRetMode;
/// Maximum number of errors in vim.ui_attach() and decor provider callbacks.
enum { CB_MAX_ERROR = 3, };
/// To use with kRetNilBool for quick truthiness check
#define LUARET_TRUTHY(res) ((res).type == kObjectTypeBoolean && (res).data.boolean == true)