Mercurial > vim
comparison src/option.c @ 17845:b6acc24df7de v8.1.1919
patch 8.1.1919: using window options when passing a buffer to popup_create()
Commit: https://github.com/vim/vim/commit/4645104be4c521dfdd43621c19e96bda3cac7be2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 24 15:50:46 2019 +0200
patch 8.1.1919: using window options when passing a buffer to popup_create()
Problem: Using current window option values when passing a buffer to
popup_create().
Solution: Clear the window-local options. (closes #4857)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 24 Aug 2019 16:00:04 +0200 |
parents | 8377ec7c5824 |
children | 079e10a49ea1 |
comparison
equal
deleted
inserted
replaced
17844:168181338e11 | 17845:b6acc24df7de |
---|---|
3890 } | 3890 } |
3891 | 3891 |
3892 /* | 3892 /* |
3893 * Set all window-local and buffer-local options to the Vim default. | 3893 * Set all window-local and buffer-local options to the Vim default. |
3894 * local-global options will use the global value. | 3894 * local-global options will use the global value. |
3895 * When "do_buffer" is FALSE don't set buffer-local options. | |
3895 */ | 3896 */ |
3896 void | 3897 void |
3897 set_local_options_default(win_T *wp) | 3898 set_local_options_default(win_T *wp, int do_buffer) |
3898 { | 3899 { |
3899 win_T *save_curwin = curwin; | 3900 win_T *save_curwin = curwin; |
3900 int i; | 3901 int i; |
3901 | 3902 |
3902 curwin = wp; | 3903 curwin = wp; |
3907 { | 3908 { |
3908 struct vimoption *p = &(options[i]); | 3909 struct vimoption *p = &(options[i]); |
3909 char_u *varp = get_varp_scope(p, OPT_LOCAL); | 3910 char_u *varp = get_varp_scope(p, OPT_LOCAL); |
3910 | 3911 |
3911 if (p->indir != PV_NONE | 3912 if (p->indir != PV_NONE |
3913 && (do_buffer || (p->indir & PV_BUF) == 0) | |
3912 && !(options[i].flags & P_NODEFAULT) | 3914 && !(options[i].flags & P_NODEFAULT) |
3913 && !optval_default(p, varp, FALSE)) | 3915 && !optval_default(p, varp, FALSE)) |
3914 set_option_default(i, OPT_LOCAL, FALSE); | 3916 set_option_default(i, OPT_LOCAL, FALSE); |
3915 } | 3917 } |
3916 | 3918 |