aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/helpers.c
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@protonmail.com>2021-10-19 01:44:17 +0600
committerGitHub <noreply@github.com>2021-10-18 12:44:17 -0700
commit9086938f7bd6d6ccb7f4a30fb78aeaf0d84e4471 (patch)
tree9e286903da8123085956beaf7eb9dd33e5741aad /src/nvim/api/private/helpers.c
parente7ea54a3dfaf937021e68bc690c4d27eed9c1cca (diff)
downloadrneovim-9086938f7bd6d6ccb7f4a30fb78aeaf0d84e4471.tar.gz
rneovim-9086938f7bd6d6ccb7f4a30fb78aeaf0d84e4471.tar.bz2
rneovim-9086938f7bd6d6ccb7f4a30fb78aeaf0d84e4471.zip
feat(api): evaluate statusline string #16020
Adds API function `nvim_eval_statusline` to allow evaluating a statusline string and obtaining information regarding it. Closes https://github.com/neovim/neovim/issues/15849
Diffstat (limited to 'src/nvim/api/private/helpers.c')
-rw-r--r--src/nvim/api/private/helpers.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c
index b2529db5be..f1259c8a18 100644
--- a/src/nvim/api/private/helpers.c
+++ b/src/nvim/api/private/helpers.c
@@ -1681,3 +1681,15 @@ bool set_mark(buf_T *buf, String name, Integer line, Integer col, Error *err)
}
return res;
}
+
+/// Get default statusline highlight for window
+const char *get_default_stl_hl(win_T *wp)
+{
+ if (wp == NULL) {
+ return "TabLineFill";
+ } else if (wp == curwin) {
+ return "StatusLine";
+ } else {
+ return "StatusLineNC";
+ }
+}