comparison src/popupwin.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 9696c76f2213
children bdddd215bf09
comparison
equal deleted inserted replaced
17844:168181338e11 17845:b6acc24df7de
1541 if (buf != NULL) 1541 if (buf != NULL)
1542 { 1542 {
1543 // use existing buffer 1543 // use existing buffer
1544 new_buffer = FALSE; 1544 new_buffer = FALSE;
1545 win_init_popup_win(wp, buf); 1545 win_init_popup_win(wp, buf);
1546 set_local_options_default(wp, FALSE);
1546 buffer_ensure_loaded(buf); 1547 buffer_ensure_loaded(buf);
1547 } 1548 }
1548 else 1549 else
1549 { 1550 {
1550 // create a new buffer associated with the popup 1551 // create a new buffer associated with the popup
1554 return NULL; 1555 return NULL;
1555 ml_open(buf); 1556 ml_open(buf);
1556 1557
1557 win_init_popup_win(wp, buf); 1558 win_init_popup_win(wp, buf);
1558 1559
1559 set_local_options_default(wp); 1560 set_local_options_default(wp, TRUE);
1560 set_string_option_direct_in_buf(buf, (char_u *)"buftype", -1, 1561 set_string_option_direct_in_buf(buf, (char_u *)"buftype", -1,
1561 (char_u *)"popup", OPT_FREE|OPT_LOCAL, 0); 1562 (char_u *)"popup", OPT_FREE|OPT_LOCAL, 0);
1562 set_string_option_direct_in_buf(buf, (char_u *)"bufhidden", -1, 1563 set_string_option_direct_in_buf(buf, (char_u *)"bufhidden", -1,
1563 (char_u *)"wipe", OPT_FREE|OPT_LOCAL, 0); 1564 (char_u *)"wipe", OPT_FREE|OPT_LOCAL, 0);
1564 buf->b_p_ul = -1; // no undo 1565 buf->b_p_ul = -1; // no undo