diff options
author | Michael Ennen <mike.ennen@gmail.com> | 2016-11-24 23:59:10 -0700 |
---|---|---|
committer | Michael Ennen <mike.ennen@gmail.com> | 2016-11-25 18:23:36 -0700 |
commit | 22c7dbd5f886a5ec116a6863bb527d99f5152eeb (patch) | |
tree | b5e65a07c4c0cce50b1146472477b2faa70fbfbf /src/nvim/screen.c | |
parent | 5f0260808cf3712718555ee177476b8aefd78280 (diff) | |
download | rneovim-22c7dbd5f886a5ec116a6863bb527d99f5152eeb.tar.gz rneovim-22c7dbd5f886a5ec116a6863bb527d99f5152eeb.tar.bz2 rneovim-22c7dbd5f886a5ec116a6863bb527d99f5152eeb.zip |
vim-patch:7.4.1711
Problem: When using try/catch in 'statusline' it is still considered an
error and the status line will be disabled.
Solution: Check did_emsg instead of called_emsg. (haya14busa, closes vim/vim#729)
https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index cee3c62f43..591f781e0e 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -4939,8 +4939,8 @@ void win_redr_status(win_T *wp) */ static void redraw_custom_statusline(win_T *wp) { - static int entered = FALSE; - int save_called_emsg = called_emsg; + static int entered = false; + int saved_did_emsg = did_emsg; /* When called recursively return. This can happen when the statusline * contains an expression that triggers a redraw. */ @@ -4948,18 +4948,18 @@ static void redraw_custom_statusline(win_T *wp) return; entered = TRUE; - called_emsg = FALSE; - win_redr_custom(wp, FALSE); - if (called_emsg) { - /* When there is an error disable the statusline, otherwise the - * display is messed up with errors and a redraw triggers the problem - * again and again. */ + did_emsg = false; + win_redr_custom(wp, false); + if (did_emsg) { + // When there is an error disable the statusline, otherwise the + // display is messed up with errors and a redraw triggers the problem + // again and again. set_string_option_direct((char_u *)"statusline", -1, (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL ? OPT_LOCAL : OPT_GLOBAL), SID_ERROR); } - called_emsg |= save_called_emsg; - entered = FALSE; + did_emsg |= saved_did_emsg; + entered = false; } /* |