comparison src/ex_cmds.c @ 18763:49b78d6465e5 v8.1.2371

patch 8.1.2371: FEAT_TEXT_PROP is a confusing name Commit: https://github.com/vim/vim/commit/05ad5ff0ab34ed9a5296dedd420ca81698b8ce22 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 30 22:48:27 2019 +0100 patch 8.1.2371: FEAT_TEXT_PROP is a confusing name Problem: FEAT_TEXT_PROP is a confusing name. Solution: Use FEAT_PROP_POPUP. (Naruhiko Nishino, closes https://github.com/vim/vim/issues/5291)
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Nov 2019 23:00:05 +0100
parents e9b2ade1adbd
children 068337e86133
comparison
equal deleted inserted replaced
18762:19582783e5ad 18763:49b78d6465e5
2951 */ 2951 */
2952 orig_pos = curwin->w_cursor; 2952 orig_pos = curwin->w_cursor;
2953 topline = curwin->w_topline; 2953 topline = curwin->w_topline;
2954 if (!oldbuf) /* need to read the file */ 2954 if (!oldbuf) /* need to read the file */
2955 { 2955 {
2956 #ifdef FEAT_TEXT_PROP 2956 #ifdef FEAT_PROP_POPUP
2957 // Don't use the swap-exists dialog for a popup window, can't edit 2957 // Don't use the swap-exists dialog for a popup window, can't edit
2958 // the buffer. 2958 // the buffer.
2959 if (WIN_IS_POPUP(curwin)) 2959 if (WIN_IS_POPUP(curwin))
2960 curbuf->b_flags |= BF_NO_SEA; 2960 curbuf->b_flags |= BF_NO_SEA;
2961 #endif 2961 #endif
2970 retval = FAIL; 2970 retval = FAIL;
2971 #else 2971 #else
2972 (void)open_buffer(FALSE, eap, readfile_flags); 2972 (void)open_buffer(FALSE, eap, readfile_flags);
2973 #endif 2973 #endif
2974 2974
2975 #ifdef FEAT_TEXT_PROP 2975 #ifdef FEAT_PROP_POPUP
2976 curbuf->b_flags &= ~BF_NO_SEA; 2976 curbuf->b_flags &= ~BF_NO_SEA;
2977 #endif 2977 #endif
2978 if (swap_exists_action == SEA_QUIT) 2978 if (swap_exists_action == SEA_QUIT)
2979 retval = FAIL; 2979 retval = FAIL;
2980 handle_swap_exists(&old_curbuf); 2980 handle_swap_exists(&old_curbuf);
3014 changed_line_abv_curs(); 3014 changed_line_abv_curs();
3015 3015
3016 #ifdef FEAT_TITLE 3016 #ifdef FEAT_TITLE
3017 maketitle(); 3017 maketitle();
3018 #endif 3018 #endif
3019 #ifdef FEAT_TEXT_PROP 3019 #ifdef FEAT_PROP_POPUP
3020 if (WIN_IS_POPUP(curwin) && curwin->w_p_pvw && retval != FAIL) 3020 if (WIN_IS_POPUP(curwin) && curwin->w_p_pvw && retval != FAIL)
3021 popup_set_title(curwin); 3021 popup_set_title(curwin);
3022 #endif 3022 #endif
3023 } 3023 }
3024 3024
3898 int len, copy_len, needed_len; 3898 int len, copy_len, needed_len;
3899 long nmatch_tl = 0; /* nr of lines matched below lnum */ 3899 long nmatch_tl = 0; /* nr of lines matched below lnum */
3900 int do_again; /* do it again after joining lines */ 3900 int do_again; /* do it again after joining lines */
3901 int skip_match = FALSE; 3901 int skip_match = FALSE;
3902 linenr_T sub_firstlnum; /* nr of first sub line */ 3902 linenr_T sub_firstlnum; /* nr of first sub line */
3903 #ifdef FEAT_TEXT_PROP 3903 #ifdef FEAT_PROP_POPUP
3904 int apc_flags = APC_SAVE_FOR_UNDO | APC_SUBSTITUTE; 3904 int apc_flags = APC_SAVE_FOR_UNDO | APC_SUBSTITUTE;
3905 colnr_T total_added = 0; 3905 colnr_T total_added = 0;
3906 #endif 3906 #endif
3907 3907
3908 /* 3908 /*
4315 * needed. 4315 * needed.
4316 */ 4316 */
4317 if (nmatch == 1) 4317 if (nmatch == 1)
4318 { 4318 {
4319 p1 = sub_firstline; 4319 p1 = sub_firstline;
4320 #ifdef FEAT_TEXT_PROP 4320 #ifdef FEAT_PROP_POPUP
4321 if (curbuf->b_has_textprop) 4321 if (curbuf->b_has_textprop)
4322 { 4322 {
4323 int bytes_added = sublen - 1 - (regmatch.endpos[0].col 4323 int bytes_added = sublen - 1 - (regmatch.endpos[0].col
4324 - regmatch.startpos[0].col); 4324 - regmatch.startpos[0].col);
4325 4325
4433 for (p1 = new_end; *p1; ++p1) 4433 for (p1 = new_end; *p1; ++p1)
4434 { 4434 {
4435 if (p1[0] == '\\' && p1[1] != NUL) /* remove backslash */ 4435 if (p1[0] == '\\' && p1[1] != NUL) /* remove backslash */
4436 { 4436 {
4437 STRMOVE(p1, p1 + 1); 4437 STRMOVE(p1, p1 + 1);
4438 #ifdef FEAT_TEXT_PROP 4438 #ifdef FEAT_PROP_POPUP
4439 if (curbuf->b_has_textprop) 4439 if (curbuf->b_has_textprop)
4440 { 4440 {
4441 // When text properties are changed, need to save 4441 // When text properties are changed, need to save
4442 // for undo first, unless done already. 4442 // for undo first, unless done already.
4443 if (adjust_prop_columns(lnum, 4443 if (adjust_prop_columns(lnum,
4462 { 4462 {
4463 if (first_line == 0) 4463 if (first_line == 0)
4464 first_line = lnum; 4464 first_line = lnum;
4465 last_line = lnum + 1; 4465 last_line = lnum + 1;
4466 } 4466 }
4467 #ifdef FEAT_TEXT_PROP 4467 #ifdef FEAT_PROP_POPUP
4468 adjust_props_for_split(lnum + 1, lnum, plen, 1); 4468 adjust_props_for_split(lnum + 1, lnum, plen, 1);
4469 #endif 4469 #endif
4470 // all line numbers increase 4470 // all line numbers increase
4471 ++sub_firstlnum; 4471 ++sub_firstlnum;
4472 ++lnum; 4472 ++lnum;
4991 /* 4991 /*
4992 * If there is already a preview window open, use that one. 4992 * If there is already a preview window open, use that one.
4993 */ 4993 */
4994 if (!curwin->w_p_pvw) 4994 if (!curwin->w_p_pvw)
4995 { 4995 {
4996 # ifdef FEAT_TEXT_PROP 4996 # ifdef FEAT_PROP_POPUP
4997 if (use_previewpopup && *p_pvp != NUL) 4997 if (use_previewpopup && *p_pvp != NUL)
4998 { 4998 {
4999 wp = popup_find_preview_window(); 4999 wp = popup_find_preview_window();
5000 if (wp != NULL) 5000 if (wp != NULL)
5001 popup_set_wantpos_cursor(wp, wp->w_minwidth, NULL); 5001 popup_set_wantpos_cursor(wp, wp->w_minwidth, NULL);
5026 else 5026 else
5027 { 5027 {
5028 /* 5028 /*
5029 * There is no preview window open yet. Create one. 5029 * There is no preview window open yet. Create one.
5030 */ 5030 */
5031 # ifdef FEAT_TEXT_PROP 5031 # ifdef FEAT_PROP_POPUP
5032 if ((use_previewpopup && *p_pvp != NUL) 5032 if ((use_previewpopup && *p_pvp != NUL)
5033 || use_popup != USEPOPUP_NONE) 5033 || use_popup != USEPOPUP_NONE)
5034 return popup_create_preview_window(use_popup != USEPOPUP_NONE); 5034 return popup_create_preview_window(use_popup != USEPOPUP_NONE);
5035 # endif 5035 # endif
5036 if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0) == FAIL) 5036 if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0) == FAIL)