diff options
author | Matthieu Coudron <teto@users.noreply.github.com> | 2021-04-18 17:12:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-18 17:12:41 +0200 |
commit | e343437bb6b82a48b1001d98a08fb5c63dccda30 (patch) | |
tree | e9f487113ba6e3402e837fc7872a250183980077 /src/nvim/option.c | |
parent | a129887c00a2d5e49fc551ba0bbffe88cefb56c0 (diff) | |
parent | 5b8575fa0dc689e6de90ee3cc6805c0f8742c320 (diff) | |
download | rneovim-e343437bb6b82a48b1001d98a08fb5c63dccda30.tar.gz rneovim-e343437bb6b82a48b1001d98a08fb5c63dccda30.tar.bz2 rneovim-e343437bb6b82a48b1001d98a08fb5c63dccda30.zip |
Merge pull request #12323 from da-x/orphaned-signs
Handle 'orphaned signs' on line deletion for signcolumn >= 2
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 914b92618c..666c526a18 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -7583,9 +7583,19 @@ int csh_like_shell(void) /// buffer signs and on user configuration. int win_signcol_count(win_T *wp) { + return win_signcol_configured(wp, NULL); +} + +/// Return the number of requested sign columns, based on user / configuration. +int win_signcol_configured(win_T *wp, int *is_fixed) +{ int minimum = 0, maximum = 1, needed_signcols; const char *scl = (const char *)wp->w_p_scl; + if (is_fixed) { + *is_fixed = 1; + } + // Note: It checks "no" or "number" in 'signcolumn' option if (*scl == 'n' && (*(scl + 1) == 'o' || (*(scl + 1) == 'u' @@ -7603,7 +7613,11 @@ int win_signcol_count(win_T *wp) return 1; } - // auto or auto:<NUM> + if (is_fixed) { + // auto or auto:<NUM> + *is_fixed = 0; + } + if (!strncmp(scl, "auto:", 5)) { // Variable depending on a configuration maximum = scl[5] - '0'; |