diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2023-02-27 16:31:05 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2023-02-27 19:50:59 +0100 |
commit | ce597235a26839826de88ecd8b949ec54c310fbd (patch) | |
tree | 145d03f0f47afef4fa7df2c6d1976de9c97049c3 /src/nvim/eval/funcs.c | |
parent | 7f424e2b65779c59fc0cac3cc7508ba2ec07f200 (diff) | |
download | rneovim-ce597235a26839826de88ecd8b949ec54c310fbd.tar.gz rneovim-ce597235a26839826de88ecd8b949ec54c310fbd.tar.bz2 rneovim-ce597235a26839826de88ecd8b949ec54c310fbd.zip |
feat(ui): restore has('gui_running')
Problem:
has('gui_running') is still common in the wild and our answer has
changed over time, causing frustration.
https://github.com/vimpostor/vim-tpipeline/commit/95a6ccbe9f33bc42dd4cee45731d8bc3fbcd92d1
Solution:
Use stdin_tty/stdout_tty to decide if a UI is (not) a GUI.
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r-- | src/nvim/eval/funcs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 1baf96e281..d97f7b6d35 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -3228,7 +3228,9 @@ static void f_has(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) } if (!n) { - if (STRNICMP(name, "patch", 5) == 0) { + if (STRNICMP(name, "gui_running", 11) == 0) { + n = ui_gui_attached(); + } else if (STRNICMP(name, "patch", 5) == 0) { if (name[5] == '-' && strlen(name) >= 11 && ascii_isdigit(name[6]) |