mirror of
https://github.com/vim/vim.git
synced 2025-09-04 21:33:48 -04:00
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 #5291)
This commit is contained in:
parent
0c5c3faef2
commit
05ad5ff0ab
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "vim.h"
|
#include "vim.h"
|
||||||
|
|
||||||
#if defined(FEAT_BEVAL) || defined(FEAT_TEXT_PROP) || defined(PROTO)
|
#if defined(FEAT_BEVAL) || defined(FEAT_PROP_POPUP) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Find text under the mouse position "row" / "col".
|
* Find text under the mouse position "row" / "col".
|
||||||
* If "getword" is TRUE the returned text in "*textp" is not the whole line but
|
* If "getword" is TRUE the returned text in "*textp" is not the whole line but
|
||||||
|
@ -861,7 +861,7 @@ buf_freeall(buf_T *buf, int flags)
|
|||||||
#ifdef FEAT_SYN_HL
|
#ifdef FEAT_SYN_HL
|
||||||
syntax_clear(&buf->b_s); // reset syntax info
|
syntax_clear(&buf->b_s); // reset syntax info
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
clear_buf_prop_types(buf);
|
clear_buf_prop_types(buf);
|
||||||
#endif
|
#endif
|
||||||
buf->b_flags &= ~BF_READERR; // a read error is no longer relevant
|
buf->b_flags &= ~BF_READERR; // a read error is no longer relevant
|
||||||
@ -5522,7 +5522,7 @@ buf_spname(buf_T *buf)
|
|||||||
if (bt_prompt(buf))
|
if (bt_prompt(buf))
|
||||||
return (char_u *)_("[Prompt]");
|
return (char_u *)_("[Prompt]");
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (bt_popup(buf))
|
if (bt_popup(buf))
|
||||||
return (char_u *)_("[Popup]");
|
return (char_u *)_("[Popup]");
|
||||||
#endif
|
#endif
|
||||||
|
@ -698,7 +698,7 @@ changed_bytes(linenr_T lnum, colnr_T col)
|
|||||||
static void
|
static void
|
||||||
inserted_bytes(linenr_T lnum, colnr_T col, int added UNUSED)
|
inserted_bytes(linenr_T lnum, colnr_T col, int added UNUSED)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (curbuf->b_has_textprop && added != 0)
|
if (curbuf->b_has_textprop && added != 0)
|
||||||
adjust_prop_columns(lnum, col, added, 0);
|
adjust_prop_columns(lnum, col, added, 0);
|
||||||
#endif
|
#endif
|
||||||
@ -1289,7 +1289,7 @@ del_bytes(
|
|||||||
mch_memmove(newp + col, oldp + col + count, (size_t)movelen);
|
mch_memmove(newp + col, oldp + col + count, (size_t)movelen);
|
||||||
if (alloc_newp)
|
if (alloc_newp)
|
||||||
ml_replace(lnum, newp, FALSE);
|
ml_replace(lnum, newp, FALSE);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Also move any following text properties.
|
// Also move any following text properties.
|
||||||
@ -2075,7 +2075,7 @@ open_line(
|
|||||||
)
|
)
|
||||||
mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L);
|
mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L);
|
||||||
did_append = TRUE;
|
did_append = TRUE;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if ((State & INSERT) && !(State & VREPLACE_FLAG))
|
if ((State & INSERT) && !(State & VREPLACE_FLAG))
|
||||||
// properties after the split move to the next line
|
// properties after the split move to the next line
|
||||||
adjust_props_for_split(curwin->w_cursor.lnum, curwin->w_cursor.lnum,
|
adjust_props_for_split(curwin->w_cursor.lnum, curwin->w_cursor.lnum,
|
||||||
|
@ -182,7 +182,7 @@ get_sign_display_info(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
static textprop_T *current_text_props = NULL;
|
static textprop_T *current_text_props = NULL;
|
||||||
static buf_T *current_buf = NULL;
|
static buf_T *current_buf = NULL;
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ win_line(
|
|||||||
int *color_cols = NULL; // pointer to according columns array
|
int *color_cols = NULL; // pointer to according columns array
|
||||||
#endif
|
#endif
|
||||||
int eol_hl_off = 0; // 1 if highlighted char after EOL
|
int eol_hl_off = 0; // 1 if highlighted char after EOL
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
int text_prop_count;
|
int text_prop_count;
|
||||||
int text_prop_next = 0; // next text property to use
|
int text_prop_next = 0; // next text property to use
|
||||||
textprop_T *text_props = NULL;
|
textprop_T *text_props = NULL;
|
||||||
@ -752,7 +752,7 @@ win_line(
|
|||||||
area_highlighting = TRUE;
|
area_highlighting = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (WIN_IS_POPUP(wp))
|
if (WIN_IS_POPUP(wp))
|
||||||
screen_line_flags |= SLF_POPUP;
|
screen_line_flags |= SLF_POPUP;
|
||||||
#endif
|
#endif
|
||||||
@ -924,7 +924,7 @@ win_line(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
{
|
{
|
||||||
char_u *prop_start;
|
char_u *prop_start;
|
||||||
|
|
||||||
@ -1347,7 +1347,7 @@ win_line(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (text_props != NULL)
|
if (text_props != NULL)
|
||||||
{
|
{
|
||||||
int pi;
|
int pi;
|
||||||
@ -1472,7 +1472,7 @@ win_line(
|
|||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
// Combine text property highlight into syntax highlight.
|
// Combine text property highlight into syntax highlight.
|
||||||
if (text_prop_type != NULL)
|
if (text_prop_type != NULL)
|
||||||
{
|
{
|
||||||
@ -3124,7 +3124,7 @@ win_line(
|
|||||||
cap_col = 0;
|
cap_col = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
vim_free(text_props);
|
vim_free(text_props);
|
||||||
vim_free(text_prop_idxs);
|
vim_free(text_prop_idxs);
|
||||||
#endif
|
#endif
|
||||||
|
@ -149,7 +149,7 @@ update_screen(int type_arg)
|
|||||||
}
|
}
|
||||||
updating_screen = TRUE;
|
updating_screen = TRUE;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Update popup_mask if needed. This may set w_redraw_top and w_redraw_bot
|
// Update popup_mask if needed. This may set w_redraw_top and w_redraw_bot
|
||||||
// in some windows.
|
// in some windows.
|
||||||
may_update_popup_mask(type);
|
may_update_popup_mask(type);
|
||||||
@ -335,7 +335,7 @@ update_screen(int type_arg)
|
|||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp)
|
||||||
wp->w_buffer->b_mod_set = FALSE;
|
wp->w_buffer->b_mod_set = FALSE;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Display popup windows on top of the windows and command line.
|
// Display popup windows on top of the windows and command line.
|
||||||
update_popups(win_update);
|
update_popups(win_update);
|
||||||
#endif
|
#endif
|
||||||
@ -2476,7 +2476,7 @@ win_update(win_T *wp)
|
|||||||
wp->w_filler_rows = wp->w_height - srow;
|
wp->w_filler_rows = wp->w_height - srow;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
else if (WIN_IS_POPUP(wp))
|
else if (WIN_IS_POPUP(wp))
|
||||||
{
|
{
|
||||||
// popup line that doesn't fit is left as-is
|
// popup line that doesn't fit is left as-is
|
||||||
@ -2585,7 +2585,7 @@ win_update(win_T *wp)
|
|||||||
!= (VALID_WCOL|VALID_WROW))
|
!= (VALID_WCOL|VALID_WROW))
|
||||||
{
|
{
|
||||||
// A win_line() call applied a fix to screen cursor column to
|
// A win_line() call applied a fix to screen cursor column to
|
||||||
// accomodate concealment of cursor line, but in this call to
|
// accommodate concealment of cursor line, but in this call to
|
||||||
// update_topline() the cursor's row or column got invalidated.
|
// update_topline() the cursor's row or column got invalidated.
|
||||||
// If they are left invalid, setcursor() will recompute them
|
// If they are left invalid, setcursor() will recompute them
|
||||||
// but there won't be any further win_line() call to re-fix the
|
// but there won't be any further win_line() call to re-fix the
|
||||||
@ -2647,7 +2647,7 @@ update_prepare(void)
|
|||||||
#ifdef FEAT_SEARCH_EXTRA
|
#ifdef FEAT_SEARCH_EXTRA
|
||||||
start_search_hl();
|
start_search_hl();
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Update popup_mask if needed.
|
// Update popup_mask if needed.
|
||||||
may_update_popup_mask(must_redraw);
|
may_update_popup_mask(must_redraw);
|
||||||
#endif
|
#endif
|
||||||
@ -2763,7 +2763,7 @@ updateWindow(win_T *wp)
|
|||||||
)
|
)
|
||||||
win_redr_status(wp, FALSE);
|
win_redr_status(wp, FALSE);
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Display popup windows on top of everything.
|
// Display popup windows on top of everything.
|
||||||
update_popups(win_update);
|
update_popups(win_update);
|
||||||
#endif
|
#endif
|
||||||
|
12
src/edit.c
12
src/edit.c
@ -1417,7 +1417,7 @@ ins_redraw(int ready) // not busy with something
|
|||||||
/* Trigger CursorMoved if the cursor moved. Not when the popup menu is
|
/* Trigger CursorMoved if the cursor moved. Not when the popup menu is
|
||||||
* visible, the command might delete it. */
|
* visible, the command might delete it. */
|
||||||
if (ready && (has_cursormovedI()
|
if (ready && (has_cursormovedI()
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
|| popup_visible
|
|| popup_visible
|
||||||
# endif
|
# endif
|
||||||
# if defined(FEAT_CONCEAL)
|
# if defined(FEAT_CONCEAL)
|
||||||
@ -1442,7 +1442,7 @@ ins_redraw(int ready) // not busy with something
|
|||||||
update_curswant();
|
update_curswant();
|
||||||
ins_apply_autocmds(EVENT_CURSORMOVEDI);
|
ins_apply_autocmds(EVENT_CURSORMOVEDI);
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (popup_visible)
|
if (popup_visible)
|
||||||
popup_check_cursor_pos();
|
popup_check_cursor_pos();
|
||||||
#endif
|
#endif
|
||||||
@ -3775,7 +3775,7 @@ replace_do_bs(int limit_col)
|
|||||||
cc = replace_pop();
|
cc = replace_pop();
|
||||||
if (cc > 0)
|
if (cc > 0)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
size_t len_before = 0; // init to shut up GCC
|
size_t len_before = 0; // init to shut up GCC
|
||||||
|
|
||||||
if (curbuf->b_has_textprop)
|
if (curbuf->b_has_textprop)
|
||||||
@ -3835,7 +3835,7 @@ replace_do_bs(int limit_col)
|
|||||||
// mark the buffer as changed and prepare for displaying
|
// mark the buffer as changed and prepare for displaying
|
||||||
changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col);
|
changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col);
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (curbuf->b_has_textprop)
|
if (curbuf->b_has_textprop)
|
||||||
{
|
{
|
||||||
size_t len_now = STRLEN(ml_get_curline());
|
size_t len_now = STRLEN(ml_get_curline());
|
||||||
@ -4807,7 +4807,7 @@ ins_bs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Delete upto starting point, start of line or previous word.
|
* Delete up to starting point, start of line or previous word.
|
||||||
*/
|
*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -5609,7 +5609,7 @@ ins_tab(void)
|
|||||||
if ((State & REPLACE_FLAG) && !(State & VREPLACE_FLAG))
|
if ((State & REPLACE_FLAG) && !(State & VREPLACE_FLAG))
|
||||||
for (temp = i; --temp >= 0; )
|
for (temp = i; --temp >= 0; )
|
||||||
replace_join(repl_off);
|
replace_join(repl_off);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
curbuf->b_ml.ml_line_len -= i;
|
curbuf->b_ml.ml_line_len -= i;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -3890,7 +3890,7 @@ garbage_collect(int testing)
|
|||||||
if (aucmd_win != NULL)
|
if (aucmd_win != NULL)
|
||||||
abort = abort || set_ref_in_item(&aucmd_win->w_winvar.di_tv, copyID,
|
abort = abort || set_ref_in_item(&aucmd_win->w_winvar.di_tv, copyID,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
||||||
abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID,
|
abort = abort || set_ref_in_item(&wp->w_winvar.di_tv, copyID,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
@ -3954,7 +3954,7 @@ garbage_collect(int testing)
|
|||||||
abort = abort || set_ref_in_term(copyID);
|
abort = abort || set_ref_in_term(copyID);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
abort = abort || set_ref_in_popups(copyID);
|
abort = abort || set_ref_in_popups(copyID);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -565,7 +565,7 @@ get_buffer_info(buf_T *buf)
|
|||||||
dict_add_list(dict, "windows", windows);
|
dict_add_list(dict, "windows", windows);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// List of popup windows displaying this buffer
|
// List of popup windows displaying this buffer
|
||||||
windows = list_alloc();
|
windows = list_alloc();
|
||||||
if (windows != NULL)
|
if (windows != NULL)
|
||||||
|
@ -584,7 +584,7 @@ static funcentry_T global_functions[] =
|
|||||||
#ifdef FEAT_PERL
|
#ifdef FEAT_PERL
|
||||||
{"perleval", 1, 1, FEARG_1, f_perleval},
|
{"perleval", 1, 1, FEARG_1, f_perleval},
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
{"popup_atcursor", 2, 2, FEARG_1, f_popup_atcursor},
|
{"popup_atcursor", 2, 2, FEARG_1, f_popup_atcursor},
|
||||||
{"popup_beval", 2, 2, FEARG_1, f_popup_beval},
|
{"popup_beval", 2, 2, FEARG_1, f_popup_beval},
|
||||||
{"popup_clear", 0, 0, 0, f_popup_clear},
|
{"popup_clear", 0, 0, 0, f_popup_clear},
|
||||||
@ -616,7 +616,7 @@ static funcentry_T global_functions[] =
|
|||||||
{"prompt_setinterrupt", 2, 2, FEARG_1, f_prompt_setinterrupt},
|
{"prompt_setinterrupt", 2, 2, FEARG_1, f_prompt_setinterrupt},
|
||||||
{"prompt_setprompt", 2, 2, FEARG_1, f_prompt_setprompt},
|
{"prompt_setprompt", 2, 2, FEARG_1, f_prompt_setprompt},
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
{"prop_add", 3, 3, FEARG_1, f_prop_add},
|
{"prop_add", 3, 3, FEARG_1, f_prop_add},
|
||||||
{"prop_clear", 1, 3, FEARG_1, f_prop_clear},
|
{"prop_clear", 1, 3, FEARG_1, f_prop_clear},
|
||||||
{"prop_list", 1, 2, FEARG_1, f_prop_list},
|
{"prop_list", 1, 2, FEARG_1, f_prop_list},
|
||||||
@ -3532,6 +3532,9 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
"pythonx",
|
"pythonx",
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef FEAT_PROP_POPUP
|
||||||
|
"popupwin",
|
||||||
|
#endif
|
||||||
#ifdef FEAT_POSTSCRIPT
|
#ifdef FEAT_POSTSCRIPT
|
||||||
"postscript",
|
"postscript",
|
||||||
#endif
|
#endif
|
||||||
@ -3608,7 +3611,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
#ifdef FEAT_TEXTOBJ
|
#ifdef FEAT_TEXTOBJ
|
||||||
"textobjects",
|
"textobjects",
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
"textprop",
|
"textprop",
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_TGETENT
|
#ifdef HAVE_TGETENT
|
||||||
|
@ -103,7 +103,7 @@ win_id2wp_tp(int id, tabpage_T **tpp)
|
|||||||
*tpp = tp;
|
*tpp = tp;
|
||||||
return wp;
|
return wp;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// popup windows are in separate lists
|
// popup windows are in separate lists
|
||||||
FOR_ALL_TABPAGES(tp)
|
FOR_ALL_TABPAGES(tp)
|
||||||
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
||||||
@ -181,7 +181,7 @@ find_win_by_nr(
|
|||||||
}
|
}
|
||||||
if (nr >= LOWEST_WIN_ID)
|
if (nr >= LOWEST_WIN_ID)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// check tab-local popup windows
|
// check tab-local popup windows
|
||||||
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
||||||
if (wp->w_id == nr)
|
if (wp->w_id == nr)
|
||||||
@ -199,6 +199,7 @@ find_win_by_nr(
|
|||||||
/*
|
/*
|
||||||
* Find a window: When using a Window ID in any tab page, when using a number
|
* Find a window: When using a Window ID in any tab page, when using a number
|
||||||
* in the current tab page.
|
* in the current tab page.
|
||||||
|
* Returns NULL when not found.
|
||||||
*/
|
*/
|
||||||
win_T *
|
win_T *
|
||||||
find_win_by_nr_or_id(typval_T *vp)
|
find_win_by_nr_or_id(typval_T *vp)
|
||||||
@ -1137,7 +1138,7 @@ restore_win_noblock(
|
|||||||
curwin = save_curwin;
|
curwin = save_curwin;
|
||||||
curbuf = curwin->w_buffer;
|
curbuf = curwin->w_buffer;
|
||||||
}
|
}
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
else if (WIN_IS_POPUP(curwin))
|
else if (WIN_IS_POPUP(curwin))
|
||||||
// original window was closed and now we're in a popup window: Go
|
// original window was closed and now we're in a popup window: Go
|
||||||
// to the first valid window.
|
// to the first valid window.
|
||||||
|
@ -2953,7 +2953,7 @@ do_ecmd(
|
|||||||
topline = curwin->w_topline;
|
topline = curwin->w_topline;
|
||||||
if (!oldbuf) /* need to read the file */
|
if (!oldbuf) /* need to read the file */
|
||||||
{
|
{
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Don't use the swap-exists dialog for a popup window, can't edit
|
// Don't use the swap-exists dialog for a popup window, can't edit
|
||||||
// the buffer.
|
// the buffer.
|
||||||
if (WIN_IS_POPUP(curwin))
|
if (WIN_IS_POPUP(curwin))
|
||||||
@ -2972,7 +2972,7 @@ do_ecmd(
|
|||||||
(void)open_buffer(FALSE, eap, readfile_flags);
|
(void)open_buffer(FALSE, eap, readfile_flags);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
curbuf->b_flags &= ~BF_NO_SEA;
|
curbuf->b_flags &= ~BF_NO_SEA;
|
||||||
#endif
|
#endif
|
||||||
if (swap_exists_action == SEA_QUIT)
|
if (swap_exists_action == SEA_QUIT)
|
||||||
@ -3016,7 +3016,7 @@ do_ecmd(
|
|||||||
#ifdef FEAT_TITLE
|
#ifdef FEAT_TITLE
|
||||||
maketitle();
|
maketitle();
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (WIN_IS_POPUP(curwin) && curwin->w_p_pvw && retval != FAIL)
|
if (WIN_IS_POPUP(curwin) && curwin->w_p_pvw && retval != FAIL)
|
||||||
popup_set_title(curwin);
|
popup_set_title(curwin);
|
||||||
#endif
|
#endif
|
||||||
@ -3900,7 +3900,7 @@ do_sub(exarg_T *eap)
|
|||||||
int do_again; /* do it again after joining lines */
|
int do_again; /* do it again after joining lines */
|
||||||
int skip_match = FALSE;
|
int skip_match = FALSE;
|
||||||
linenr_T sub_firstlnum; /* nr of first sub line */
|
linenr_T sub_firstlnum; /* nr of first sub line */
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
int apc_flags = APC_SAVE_FOR_UNDO | APC_SUBSTITUTE;
|
int apc_flags = APC_SAVE_FOR_UNDO | APC_SUBSTITUTE;
|
||||||
colnr_T total_added = 0;
|
colnr_T total_added = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -4317,7 +4317,7 @@ do_sub(exarg_T *eap)
|
|||||||
if (nmatch == 1)
|
if (nmatch == 1)
|
||||||
{
|
{
|
||||||
p1 = sub_firstline;
|
p1 = sub_firstline;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (curbuf->b_has_textprop)
|
if (curbuf->b_has_textprop)
|
||||||
{
|
{
|
||||||
int bytes_added = sublen - 1 - (regmatch.endpos[0].col
|
int bytes_added = sublen - 1 - (regmatch.endpos[0].col
|
||||||
@ -4435,7 +4435,7 @@ do_sub(exarg_T *eap)
|
|||||||
if (p1[0] == '\\' && p1[1] != NUL) /* remove backslash */
|
if (p1[0] == '\\' && p1[1] != NUL) /* remove backslash */
|
||||||
{
|
{
|
||||||
STRMOVE(p1, p1 + 1);
|
STRMOVE(p1, p1 + 1);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (curbuf->b_has_textprop)
|
if (curbuf->b_has_textprop)
|
||||||
{
|
{
|
||||||
// When text properties are changed, need to save
|
// When text properties are changed, need to save
|
||||||
@ -4464,7 +4464,7 @@ do_sub(exarg_T *eap)
|
|||||||
first_line = lnum;
|
first_line = lnum;
|
||||||
last_line = lnum + 1;
|
last_line = lnum + 1;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
adjust_props_for_split(lnum + 1, lnum, plen, 1);
|
adjust_props_for_split(lnum + 1, lnum, plen, 1);
|
||||||
#endif
|
#endif
|
||||||
// all line numbers increase
|
// all line numbers increase
|
||||||
@ -4993,7 +4993,7 @@ prepare_tagpreview(
|
|||||||
*/
|
*/
|
||||||
if (!curwin->w_p_pvw)
|
if (!curwin->w_p_pvw)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
if (use_previewpopup && *p_pvp != NUL)
|
if (use_previewpopup && *p_pvp != NUL)
|
||||||
{
|
{
|
||||||
wp = popup_find_preview_window();
|
wp = popup_find_preview_window();
|
||||||
@ -5028,7 +5028,7 @@ prepare_tagpreview(
|
|||||||
/*
|
/*
|
||||||
* There is no preview window open yet. Create one.
|
* There is no preview window open yet. Create one.
|
||||||
*/
|
*/
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
if ((use_previewpopup && *p_pvp != NUL)
|
if ((use_previewpopup && *p_pvp != NUL)
|
||||||
|| use_popup != USEPOPUP_NONE)
|
|| use_popup != USEPOPUP_NONE)
|
||||||
return popup_create_preview_window(use_popup != USEPOPUP_NONE);
|
return popup_create_preview_window(use_popup != USEPOPUP_NONE);
|
||||||
|
@ -368,7 +368,7 @@ static void ex_folddo(exarg_T *eap);
|
|||||||
#if !defined(FEAT_X11) || !defined(FEAT_XCLIPBOARD)
|
#if !defined(FEAT_X11) || !defined(FEAT_XCLIPBOARD)
|
||||||
# define ex_xrestore ex_ni
|
# define ex_xrestore ex_ni
|
||||||
#endif
|
#endif
|
||||||
#if !defined(FEAT_TEXT_PROP)
|
#if !defined(FEAT_PROP_POPUP)
|
||||||
# define ex_popupclear ex_ni
|
# define ex_popupclear ex_ni
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -5013,7 +5013,7 @@ ex_pclose(exarg_T *eap)
|
|||||||
ex_win_close(eap->forceit, win, NULL);
|
ex_win_close(eap->forceit, win, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
// Also when 'previewpopup' is empty, it might have been cleared.
|
// Also when 'previewpopup' is empty, it might have been cleared.
|
||||||
popup_close_preview();
|
popup_close_preview();
|
||||||
# endif
|
# endif
|
||||||
@ -7812,7 +7812,7 @@ ex_pedit(exarg_T *eap)
|
|||||||
redraw_later(VALID);
|
redraw_later(VALID);
|
||||||
win_enter(curwin_save, TRUE);
|
win_enter(curwin_save, TRUE);
|
||||||
}
|
}
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
else if (WIN_IS_POPUP(curwin))
|
else if (WIN_IS_POPUP(curwin))
|
||||||
{
|
{
|
||||||
// can't keep focus in popup window
|
// can't keep focus in popup window
|
||||||
|
@ -1151,10 +1151,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* +textprop Text properties and popup windows
|
* +textprop and +popupwin Text PROPerties and POPUP windows
|
||||||
*/
|
*/
|
||||||
#if defined(FEAT_EVAL) && defined(FEAT_SYN_HL)
|
#if defined(FEAT_EVAL) && defined(FEAT_SYN_HL)
|
||||||
# define FEAT_TEXT_PROP
|
# define FEAT_PROP_POPUP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME)
|
#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME)
|
||||||
@ -1167,7 +1167,7 @@
|
|||||||
* +signs Allow signs to be displayed to the left of text lines.
|
* +signs Allow signs to be displayed to the left of text lines.
|
||||||
* Adds the ":sign" command.
|
* Adds the ":sign" command.
|
||||||
*/
|
*/
|
||||||
#if defined(FEAT_BIG) || defined(FEAT_NETBEANS_INTG) || defined(FEAT_TEXT_PROP)
|
#if defined(FEAT_BIG) || defined(FEAT_NETBEANS_INTG) || defined(FEAT_PROP_POPUP)
|
||||||
# define FEAT_SIGNS
|
# define FEAT_SIGNS
|
||||||
# if ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \
|
# if ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \
|
||||||
&& defined(HAVE_X11_XPM_H)) \
|
&& defined(HAVE_X11_XPM_H)) \
|
||||||
|
@ -1078,7 +1078,7 @@ retry:
|
|||||||
* We allocate as much space for the file as we can get, plus
|
* We allocate as much space for the file as we can get, plus
|
||||||
* space for the old line plus room for one terminating NUL.
|
* space for the old line plus room for one terminating NUL.
|
||||||
* The amount is limited by the fact that read() only can read
|
* The amount is limited by the fact that read() only can read
|
||||||
* upto max_unsigned characters (and other things).
|
* up to max_unsigned characters (and other things).
|
||||||
*/
|
*/
|
||||||
if (!skip_read)
|
if (!skip_read)
|
||||||
{
|
{
|
||||||
@ -3366,7 +3366,7 @@ shorten_fnames(int force)
|
|||||||
}
|
}
|
||||||
status_redraw_all();
|
status_redraw_all();
|
||||||
redraw_tabline = TRUE;
|
redraw_tabline = TRUE;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
popup_update_preview_title();
|
popup_update_preview_title();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1604,7 +1604,7 @@ vgetc(void)
|
|||||||
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
|
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
|
||||||
|| im_is_preediting()
|
|| im_is_preediting()
|
||||||
#endif
|
#endif
|
||||||
#if defined(FEAT_TEXT_PROP)
|
#if defined(FEAT_PROP_POPUP)
|
||||||
|| popup_no_mapping()
|
|| popup_no_mapping()
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -1822,7 +1822,7 @@ vgetc(void)
|
|||||||
ui_remove_balloon();
|
ui_remove_balloon();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (popup_do_filter(c))
|
if (popup_do_filter(c))
|
||||||
{
|
{
|
||||||
if (c == Ctrl_C)
|
if (c == Ctrl_C)
|
||||||
@ -2038,7 +2038,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
|||||||
if (win == NULL)
|
if (win == NULL)
|
||||||
return;
|
return;
|
||||||
(void)mouse_comp_pos(win, &row, &col, &lnum, NULL);
|
(void)mouse_comp_pos(win, &row, &col, &lnum, NULL);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (WIN_IS_POPUP(win))
|
if (WIN_IS_POPUP(win))
|
||||||
winnr = 0;
|
winnr = 0;
|
||||||
else
|
else
|
||||||
@ -2851,7 +2851,7 @@ vgetorpeek(int advance)
|
|||||||
/*
|
/*
|
||||||
* get a character: 2. from the typeahead buffer
|
* get a character: 2. from the typeahead buffer
|
||||||
*/
|
*/
|
||||||
c = typebuf.tb_buf[typebuf.tb_off] & 255;
|
c = typebuf.tb_buf[typebuf.tb_off];
|
||||||
if (advance) /* remove chars from tb_buf */
|
if (advance) /* remove chars from tb_buf */
|
||||||
{
|
{
|
||||||
cmd_silent = (typebuf.tb_silent > 0);
|
cmd_silent = (typebuf.tb_silent > 0);
|
||||||
|
@ -95,7 +95,7 @@ EXTERN int redrawing_for_callback INIT(= 0);
|
|||||||
*/
|
*/
|
||||||
EXTERN short *TabPageIdxs INIT(= NULL);
|
EXTERN short *TabPageIdxs INIT(= NULL);
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Array with size Rows x Columns containing zindex of popups.
|
// Array with size Rows x Columns containing zindex of popups.
|
||||||
EXTERN short *popup_mask INIT(= NULL);
|
EXTERN short *popup_mask INIT(= NULL);
|
||||||
EXTERN short *popup_mask_next INIT(= NULL);
|
EXTERN short *popup_mask_next INIT(= NULL);
|
||||||
@ -640,7 +640,7 @@ EXTERN win_T *curwin; // currently active window
|
|||||||
EXTERN win_T *aucmd_win; // window used in aucmd_prepbuf()
|
EXTERN win_T *aucmd_win; // window used in aucmd_prepbuf()
|
||||||
EXTERN int aucmd_win_used INIT(= FALSE); // aucmd_win is being used
|
EXTERN int aucmd_win_used INIT(= FALSE); // aucmd_win is being used
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
EXTERN win_T *first_popupwin; // first global popup window
|
EXTERN win_T *first_popupwin; // first global popup window
|
||||||
EXTERN win_T *popup_dragwin INIT(= NULL); // popup window being dragged
|
EXTERN win_T *popup_dragwin INIT(= NULL); // popup window being dragged
|
||||||
|
|
||||||
|
@ -4898,7 +4898,7 @@ gui_mouse_moved(int x, int y)
|
|||||||
// apply 'mousefocus' and pointer shape
|
// apply 'mousefocus' and pointer shape
|
||||||
gui_mouse_focus(x, y);
|
gui_mouse_focus(x, y);
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (popup_visible)
|
if (popup_visible)
|
||||||
// Generate a mouse-moved event, so that the popup can perhaps be
|
// Generate a mouse-moved event, so that the popup can perhaps be
|
||||||
// closed, just like in the terminal.
|
// closed, just like in the terminal.
|
||||||
@ -5152,7 +5152,7 @@ gui_update_screen(void)
|
|||||||
|
|
||||||
/* Trigger CursorMoved if the cursor moved. */
|
/* Trigger CursorMoved if the cursor moved. */
|
||||||
if (!finish_op && (has_cursormoved()
|
if (!finish_op && (has_cursormoved()
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
|| popup_visible
|
|| popup_visible
|
||||||
# endif
|
# endif
|
||||||
# ifdef FEAT_CONCEAL
|
# ifdef FEAT_CONCEAL
|
||||||
@ -5162,7 +5162,7 @@ gui_update_screen(void)
|
|||||||
{
|
{
|
||||||
if (has_cursormoved())
|
if (has_cursormoved())
|
||||||
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, FALSE, curbuf);
|
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, FALSE, curbuf);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (popup_visible)
|
if (popup_visible)
|
||||||
popup_check_cursor_pos();
|
popup_check_cursor_pos();
|
||||||
#endif
|
#endif
|
||||||
|
@ -4255,7 +4255,7 @@ _OnMouseWheel(
|
|||||||
|
|
||||||
wp = gui_mouse_window(FIND_POPUP);
|
wp = gui_mouse_window(FIND_POPUP);
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (wp != NULL && popup_is_popup(wp))
|
if (wp != NULL && popup_is_popup(wp))
|
||||||
{
|
{
|
||||||
cmdarg_T cap;
|
cmdarg_T cap;
|
||||||
|
@ -773,7 +773,7 @@ set_indent(
|
|||||||
// at the start of the indent (replacing spaces with TAB)
|
// at the start of the indent (replacing spaces with TAB)
|
||||||
saved_cursor.col = (colnr_T)(s - newline);
|
saved_cursor.col = (colnr_T)(s - newline);
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
{
|
{
|
||||||
int added = ind_len - (colnr_T)(p - oldline);
|
int added = ind_len - (colnr_T)(p - oldline);
|
||||||
|
|
||||||
|
@ -1811,7 +1811,7 @@ ins_compl_prep(int c)
|
|||||||
|| c == K_MOUSELEFT || c == K_MOUSERIGHT)
|
|| c == K_MOUSELEFT || c == K_MOUSERIGHT)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Ignore mouse events in a popup window
|
// Ignore mouse events in a popup window
|
||||||
if (is_mouse_key(c))
|
if (is_mouse_key(c))
|
||||||
{
|
{
|
||||||
|
@ -339,7 +339,7 @@
|
|||||||
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
|
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
|
||||||
|
|
||||||
// Give an error in curwin is a popup window and evaluate to TRUE.
|
// Give an error in curwin is a popup window and evaluate to TRUE.
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
# define ERROR_IF_POPUP_WINDOW error_if_popup_window()
|
# define ERROR_IF_POPUP_WINDOW error_if_popup_window()
|
||||||
#else
|
#else
|
||||||
# define ERROR_IF_POPUP_WINDOW 0
|
# define ERROR_IF_POPUP_WINDOW 0
|
||||||
|
@ -1283,7 +1283,7 @@ main_loop(
|
|||||||
/* Trigger CursorMoved if the cursor moved. */
|
/* Trigger CursorMoved if the cursor moved. */
|
||||||
if (!finish_op && (
|
if (!finish_op && (
|
||||||
has_cursormoved()
|
has_cursormoved()
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
|| popup_visible
|
|| popup_visible
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
@ -1295,7 +1295,7 @@ main_loop(
|
|||||||
if (has_cursormoved())
|
if (has_cursormoved())
|
||||||
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL,
|
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL,
|
||||||
FALSE, curbuf);
|
FALSE, curbuf);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (popup_visible)
|
if (popup_visible)
|
||||||
popup_check_cursor_pos();
|
popup_check_cursor_pos();
|
||||||
#endif
|
#endif
|
||||||
|
@ -2705,7 +2705,7 @@ ml_line_alloced(void)
|
|||||||
return (curbuf->b_ml.ml_flags & ML_LINE_DIRTY);
|
return (curbuf->b_ml.ml_flags & ML_LINE_DIRTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
static void
|
static void
|
||||||
add_text_props_for_append(
|
add_text_props_for_append(
|
||||||
buf_T *buf,
|
buf_T *buf,
|
||||||
@ -2789,7 +2789,7 @@ ml_append_int(
|
|||||||
DATA_BL *dp;
|
DATA_BL *dp;
|
||||||
PTR_BL *pp;
|
PTR_BL *pp;
|
||||||
infoptr_T *ip;
|
infoptr_T *ip;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
char_u *tofree = NULL;
|
char_u *tofree = NULL;
|
||||||
#endif
|
#endif
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
@ -2803,7 +2803,7 @@ ml_append_int(
|
|||||||
if (len == 0)
|
if (len == 0)
|
||||||
len = (colnr_T)STRLEN(line) + 1; // space needed for the text
|
len = (colnr_T)STRLEN(line) + 1; // space needed for the text
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (curbuf->b_has_textprop && lnum > 0)
|
if (curbuf->b_has_textprop && lnum > 0)
|
||||||
// Add text properties that continue from the previous line.
|
// Add text properties that continue from the previous line.
|
||||||
add_text_props_for_append(buf, lnum, &line, &len, &tofree);
|
add_text_props_for_append(buf, lnum, &line, &len, &tofree);
|
||||||
@ -3280,7 +3280,7 @@ ml_append_int(
|
|||||||
ret = OK;
|
ret = OK;
|
||||||
|
|
||||||
theend:
|
theend:
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
vim_free(tofree);
|
vim_free(tofree);
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
@ -3409,7 +3409,7 @@ ml_replace_len(
|
|||||||
if (copy)
|
if (copy)
|
||||||
{
|
{
|
||||||
// copy the line to allocated memory
|
// copy the line to allocated memory
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (has_props)
|
if (has_props)
|
||||||
line = vim_memsave(line, len);
|
line = vim_memsave(line, len);
|
||||||
else
|
else
|
||||||
@ -3432,14 +3432,14 @@ ml_replace_len(
|
|||||||
ml_flush_line(curbuf);
|
ml_flush_line(curbuf);
|
||||||
curbuf->b_ml.ml_flags &= ~ML_LINE_DIRTY;
|
curbuf->b_ml.ml_flags &= ~ML_LINE_DIRTY;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (curbuf->b_has_textprop && !has_props)
|
if (curbuf->b_has_textprop && !has_props)
|
||||||
// Need to fetch the old line to copy over any text properties.
|
// Need to fetch the old line to copy over any text properties.
|
||||||
ml_get_buf(curbuf, lnum, TRUE);
|
ml_get_buf(curbuf, lnum, TRUE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (curbuf->b_has_textprop && !has_props)
|
if (curbuf->b_has_textprop && !has_props)
|
||||||
{
|
{
|
||||||
size_t oldtextlen = STRLEN(curbuf->b_ml.ml_line_ptr) + 1;
|
size_t oldtextlen = STRLEN(curbuf->b_ml.ml_line_ptr) + 1;
|
||||||
@ -3475,7 +3475,7 @@ ml_replace_len(
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
/*
|
/*
|
||||||
* Adjust text properties in line "lnum" for a deleted line.
|
* Adjust text properties in line "lnum" for a deleted line.
|
||||||
* When "above" is true this is the line above the deleted line.
|
* When "above" is true this is the line above the deleted line.
|
||||||
@ -3614,7 +3614,7 @@ ml_delete_int(buf_T *buf, linenr_T lnum, int message)
|
|||||||
long line_size;
|
long line_size;
|
||||||
int i;
|
int i;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
char_u *textprop_save = NULL;
|
char_u *textprop_save = NULL;
|
||||||
int textprop_save_len;
|
int textprop_save_len;
|
||||||
#endif
|
#endif
|
||||||
@ -3671,7 +3671,7 @@ ml_delete_int(buf_T *buf, linenr_T lnum, int message)
|
|||||||
if (netbeans_active())
|
if (netbeans_active())
|
||||||
netbeans_removed(buf, lnum, 0, (long)line_size);
|
netbeans_removed(buf, lnum, 0, (long)line_size);
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// If there are text properties, make a copy, so that we can update
|
// If there are text properties, make a copy, so that we can update
|
||||||
// properties in preceding and following lines.
|
// properties in preceding and following lines.
|
||||||
if (buf->b_has_textprop)
|
if (buf->b_has_textprop)
|
||||||
@ -3772,7 +3772,7 @@ ml_delete_int(buf_T *buf, linenr_T lnum, int message)
|
|||||||
ret = OK;
|
ret = OK;
|
||||||
|
|
||||||
theend:
|
theend:
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (textprop_save != NULL)
|
if (textprop_save != NULL)
|
||||||
{
|
{
|
||||||
// Adjust text properties in the line above and below.
|
// Adjust text properties in the line above and below.
|
||||||
@ -5559,7 +5559,7 @@ ml_updatechunk(
|
|||||||
end_idx = count - 1;
|
end_idx = count - 1;
|
||||||
linecnt += rest;
|
linecnt += rest;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (buf->b_has_textprop)
|
if (buf->b_has_textprop)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -5768,7 +5768,7 @@ ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
|
|||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (buf->b_has_textprop)
|
if (buf->b_has_textprop)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -1148,7 +1148,7 @@ free_all_mem(void)
|
|||||||
/* Clear cmdline history. */
|
/* Clear cmdline history. */
|
||||||
p_hi = 0;
|
p_hi = 0;
|
||||||
init_history();
|
init_history();
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
clear_global_prop_types();
|
clear_global_prop_types();
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
24
src/mouse.c
24
src/mouse.c
@ -291,7 +291,7 @@ do_mouse(
|
|||||||
bevalexpr_due_set = TRUE;
|
bevalexpr_due_set = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
popup_handle_mouse_moved();
|
popup_handle_mouse_moved();
|
||||||
#endif
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1104,7 +1104,7 @@ ins_mousescroll(int dir)
|
|||||||
(long)(curwin->w_botline - curwin->w_topline));
|
(long)(curwin->w_botline - curwin->w_topline));
|
||||||
else
|
else
|
||||||
scroll_redraw(dir, 3L);
|
scroll_redraw(dir, 3L);
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
if (WIN_IS_POPUP(curwin))
|
if (WIN_IS_POPUP(curwin))
|
||||||
popup_set_firstline(curwin);
|
popup_set_firstline(curwin);
|
||||||
# endif
|
# endif
|
||||||
@ -1500,7 +1500,7 @@ jump_to_mouse(
|
|||||||
#ifdef FEAT_MENU
|
#ifdef FEAT_MENU
|
||||||
static int in_winbar = FALSE;
|
static int in_winbar = FALSE;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
static int in_popup_win = FALSE;
|
static int in_popup_win = FALSE;
|
||||||
static win_T *click_in_popup_win = NULL;
|
static win_T *click_in_popup_win = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -1530,7 +1530,7 @@ jump_to_mouse(
|
|||||||
flags &= ~(MOUSE_FOCUS | MOUSE_DID_MOVE);
|
flags &= ~(MOUSE_FOCUS | MOUSE_DID_MOVE);
|
||||||
dragwin = NULL;
|
dragwin = NULL;
|
||||||
did_drag = FALSE;
|
did_drag = FALSE;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (click_in_popup_win != NULL && popup_dragwin == NULL)
|
if (click_in_popup_win != NULL && popup_dragwin == NULL)
|
||||||
popup_close_for_mouse_click(click_in_popup_win);
|
popup_close_for_mouse_click(click_in_popup_win);
|
||||||
|
|
||||||
@ -1575,7 +1575,7 @@ retnomove:
|
|||||||
if (cmdwin_type != 0 && row < curwin->w_winrow)
|
if (cmdwin_type != 0 && row < curwin->w_winrow)
|
||||||
return IN_OTHER_WIN;
|
return IN_OTHER_WIN;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Continue a modeless selection in a popup window or dragging it.
|
// Continue a modeless selection in a popup window or dragging it.
|
||||||
if (in_popup_win)
|
if (in_popup_win)
|
||||||
{
|
{
|
||||||
@ -1623,7 +1623,7 @@ retnomove:
|
|||||||
return IN_UNKNOWN;
|
return IN_UNKNOWN;
|
||||||
dragwin = NULL;
|
dragwin = NULL;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Click in a popup window may start dragging or modeless selection,
|
// Click in a popup window may start dragging or modeless selection,
|
||||||
// but not much else.
|
// but not much else.
|
||||||
if (WIN_IS_POPUP(wp))
|
if (WIN_IS_POPUP(wp))
|
||||||
@ -1824,7 +1824,7 @@ retnomove:
|
|||||||
if (cmdwin_type != 0 && row < curwin->w_winrow)
|
if (cmdwin_type != 0 && row < curwin->w_winrow)
|
||||||
return IN_OTHER_WIN;
|
return IN_OTHER_WIN;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (in_popup_win)
|
if (in_popup_win)
|
||||||
{
|
{
|
||||||
if (popup_dragwin != NULL)
|
if (popup_dragwin != NULL)
|
||||||
@ -2014,7 +2014,7 @@ nv_mousescroll(cmdarg_T *cap)
|
|||||||
wp = mouse_find_win(&row, &col, FIND_POPUP);
|
wp = mouse_find_win(&row, &col, FIND_POPUP);
|
||||||
if (wp == NULL)
|
if (wp == NULL)
|
||||||
return;
|
return;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (WIN_IS_POPUP(wp) && !wp->w_has_scrollbar)
|
if (WIN_IS_POPUP(wp) && !wp->w_has_scrollbar)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
@ -2049,7 +2049,7 @@ nv_mousescroll(cmdarg_T *cap)
|
|||||||
cap->count0 = cap->count1;
|
cap->count0 = cap->count1;
|
||||||
nv_scroll_line(cap);
|
nv_scroll_line(cap);
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (WIN_IS_POPUP(curwin))
|
if (WIN_IS_POPUP(curwin))
|
||||||
popup_set_firstline(curwin);
|
popup_set_firstline(curwin);
|
||||||
#endif
|
#endif
|
||||||
@ -2925,7 +2925,7 @@ mouse_find_win(int *rowp, int *colp, mouse_find_T popup UNUSED)
|
|||||||
frame_T *fp;
|
frame_T *fp;
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
win_T *pwp = NULL;
|
win_T *pwp = NULL;
|
||||||
|
|
||||||
if (popup != IGNORE_POPUP)
|
if (popup != IGNORE_POPUP)
|
||||||
@ -2987,7 +2987,7 @@ mouse_find_win(int *rowp, int *colp, mouse_find_T popup UNUSED)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(NEED_VCOL2COL) || defined(FEAT_BEVAL) || defined(FEAT_TEXT_PROP) \
|
#if defined(NEED_VCOL2COL) || defined(FEAT_BEVAL) || defined(FEAT_PROP_POPUP) \
|
||||||
|| defined(PROTO)
|
|| defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Convert a virtual (screen) column to a character column.
|
* Convert a virtual (screen) column to a character column.
|
||||||
@ -3039,7 +3039,7 @@ f_getmousepos(typval_T *argvars UNUSED, typval_T *rettv)
|
|||||||
int left_off = 0;
|
int left_off = 0;
|
||||||
int height = wp->w_height + wp->w_status_height;
|
int height = wp->w_height + wp->w_status_height;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (WIN_IS_POPUP(wp))
|
if (WIN_IS_POPUP(wp))
|
||||||
{
|
{
|
||||||
top_off = popup_top_extra(wp);
|
top_off = popup_top_extra(wp);
|
||||||
|
@ -1181,7 +1181,7 @@ curs_columns(
|
|||||||
curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
|
curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (defined(FEAT_EVAL) || defined(FEAT_TEXT_PROP)) || defined(PROTO)
|
#if (defined(FEAT_EVAL) || defined(FEAT_PROP_POPUP)) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Compute the screen position of text character at "pos" in window "wp"
|
* Compute the screen position of text character at "pos" in window "wp"
|
||||||
* The resulting values are one-based, zero when character is not visible.
|
* The resulting values are one-based, zero when character is not visible.
|
||||||
|
10
src/ops.c
10
src/ops.c
@ -828,7 +828,7 @@ op_delete(oparg_T *oap)
|
|||||||
/* replace the line */
|
/* replace the line */
|
||||||
ml_replace(lnum, newp, FALSE);
|
ml_replace(lnum, newp, FALSE);
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (curbuf->b_has_textprop && n != 0)
|
if (curbuf->b_has_textprop && n != 0)
|
||||||
adjust_prop_columns(lnum, bd.textcol, -n, 0);
|
adjust_prop_columns(lnum, bd.textcol, -n, 0);
|
||||||
#endif
|
#endif
|
||||||
@ -1948,7 +1948,7 @@ do_join(
|
|||||||
int remove_comments = (use_formatoptions == TRUE)
|
int remove_comments = (use_formatoptions == TRUE)
|
||||||
&& has_format_option(FO_REMOVE_COMS);
|
&& has_format_option(FO_REMOVE_COMS);
|
||||||
int prev_was_comment;
|
int prev_was_comment;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
textprop_T **prop_lines = NULL;
|
textprop_T **prop_lines = NULL;
|
||||||
int *prop_lengths = NULL;
|
int *prop_lengths = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -2072,7 +2072,7 @@ do_join(
|
|||||||
cend = newp + sumsize;
|
cend = newp + sumsize;
|
||||||
*cend = 0;
|
*cend = 0;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// We need to move properties of the lines that are going to be deleted to
|
// We need to move properties of the lines that are going to be deleted to
|
||||||
// the new long one.
|
// the new long one.
|
||||||
if (curbuf->b_has_textprop && !text_prop_frozen)
|
if (curbuf->b_has_textprop && !text_prop_frozen)
|
||||||
@ -2114,7 +2114,7 @@ do_join(
|
|||||||
(long)(cend - newp - spaces_removed), spaces_removed);
|
(long)(cend - newp - spaces_removed), spaces_removed);
|
||||||
if (t == 0)
|
if (t == 0)
|
||||||
break;
|
break;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (prop_lines != NULL)
|
if (prop_lines != NULL)
|
||||||
adjust_props_for_join(curwin->w_cursor.lnum + t,
|
adjust_props_for_join(curwin->w_cursor.lnum + t,
|
||||||
prop_lines + t - 1, prop_lengths + t - 1,
|
prop_lines + t - 1, prop_lengths + t - 1,
|
||||||
@ -2129,7 +2129,7 @@ do_join(
|
|||||||
currsize = (int)STRLEN(curr);
|
currsize = (int)STRLEN(curr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (prop_lines != NULL)
|
if (prop_lines != NULL)
|
||||||
join_prop_lines(curwin->w_cursor.lnum, newp,
|
join_prop_lines(curwin->w_cursor.lnum, newp,
|
||||||
prop_lines, prop_lengths, count);
|
prop_lines, prop_lengths, count);
|
||||||
|
@ -567,7 +567,7 @@ EXTERN char_u *p_fp; // 'formatprg'
|
|||||||
EXTERN int p_fs; // 'fsync'
|
EXTERN int p_fs; // 'fsync'
|
||||||
#endif
|
#endif
|
||||||
EXTERN int p_gd; // 'gdefault'
|
EXTERN int p_gd; // 'gdefault'
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
# ifdef FEAT_QUICKFIX
|
# ifdef FEAT_QUICKFIX
|
||||||
EXTERN char_u *p_cpp; // 'completepopup'
|
EXTERN char_u *p_cpp; // 'completepopup'
|
||||||
# endif
|
# endif
|
||||||
|
@ -688,7 +688,7 @@ static struct vimoption options[] =
|
|||||||
{(char_u *)"menu,preview", (char_u *)0L}
|
{(char_u *)"menu,preview", (char_u *)0L}
|
||||||
SCTX_INIT},
|
SCTX_INIT},
|
||||||
{"completepopup", "cpp", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
|
{"completepopup", "cpp", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
|
||||||
#if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX)
|
#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
|
||||||
(char_u *)&p_cpp, PV_NONE,
|
(char_u *)&p_cpp, PV_NONE,
|
||||||
{(char_u *)"", (char_u *)0L}
|
{(char_u *)"", (char_u *)0L}
|
||||||
#else
|
#else
|
||||||
@ -1897,7 +1897,7 @@ static struct vimoption options[] =
|
|||||||
#endif
|
#endif
|
||||||
{(char_u *)12L, (char_u *)0L} SCTX_INIT},
|
{(char_u *)12L, (char_u *)0L} SCTX_INIT},
|
||||||
{"previewpopup", "pvp", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
|
{"previewpopup", "pvp", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
(char_u *)&p_pvp, PV_NONE,
|
(char_u *)&p_pvp, PV_NONE,
|
||||||
{(char_u *)"", (char_u *)0L}
|
{(char_u *)"", (char_u *)0L}
|
||||||
#else
|
#else
|
||||||
|
@ -2220,7 +2220,7 @@ did_set_string_option(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// 'previewpopup'
|
// 'previewpopup'
|
||||||
else if (varp == &p_pvp)
|
else if (varp == &p_pvp)
|
||||||
{
|
{
|
||||||
|
@ -429,7 +429,7 @@ pum_redraw(void)
|
|||||||
/ (pum_size - pum_height);
|
/ (pum_size - pum_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// The popup menu is drawn over popup menus with zindex under
|
// The popup menu is drawn over popup menus with zindex under
|
||||||
// POPUPMENU_ZINDEX.
|
// POPUPMENU_ZINDEX.
|
||||||
screen_zindex = POPUPMENU_ZINDEX;
|
screen_zindex = POPUPMENU_ZINDEX;
|
||||||
@ -616,12 +616,12 @@ pum_redraw(void)
|
|||||||
++row;
|
++row;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
screen_zindex = 0;
|
screen_zindex = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX)
|
#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
|
||||||
/*
|
/*
|
||||||
* Position the info popup relative to the popup menu item.
|
* Position the info popup relative to the popup menu item.
|
||||||
*/
|
*/
|
||||||
@ -683,7 +683,7 @@ pum_set_selected(int n, int repeat UNUSED)
|
|||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
int prev_selected = pum_selected;
|
int prev_selected = pum_selected;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
int has_info = FALSE;
|
int has_info = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -758,12 +758,12 @@ pum_set_selected(int n, int repeat UNUSED)
|
|||||||
win_T *curwin_save = curwin;
|
win_T *curwin_save = curwin;
|
||||||
tabpage_T *curtab_save = curtab;
|
tabpage_T *curtab_save = curtab;
|
||||||
int res = OK;
|
int res = OK;
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
use_popup_T use_popup;
|
use_popup_T use_popup;
|
||||||
# else
|
# else
|
||||||
# define use_popup USEPOPUP_NONE
|
# define use_popup USEPOPUP_NONE
|
||||||
# endif
|
# endif
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
has_info = TRUE;
|
has_info = TRUE;
|
||||||
if (strstr((char *)p_cot, "popuphidden") != NULL)
|
if (strstr((char *)p_cot, "popuphidden") != NULL)
|
||||||
use_popup = USEPOPUP_HIDDEN;
|
use_popup = USEPOPUP_HIDDEN;
|
||||||
@ -787,7 +787,7 @@ pum_set_selected(int n, int repeat UNUSED)
|
|||||||
g_do_tagpreview = 0;
|
g_do_tagpreview = 0;
|
||||||
|
|
||||||
if (curwin->w_p_pvw
|
if (curwin->w_p_pvw
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
|| (curwin->w_popup_flags & POPF_INFO)
|
|| (curwin->w_popup_flags & POPF_INFO)
|
||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
@ -862,7 +862,7 @@ pum_set_selected(int n, int repeat UNUSED)
|
|||||||
curbuf->b_p_ma = FALSE;
|
curbuf->b_p_ma = FALSE;
|
||||||
if (pum_selected != prev_selected)
|
if (pum_selected != prev_selected)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
curwin->w_firstline = 1;
|
curwin->w_firstline = 1;
|
||||||
# endif
|
# endif
|
||||||
curwin->w_topline = 1;
|
curwin->w_topline = 1;
|
||||||
@ -871,7 +871,7 @@ pum_set_selected(int n, int repeat UNUSED)
|
|||||||
curwin->w_topline = curbuf->b_ml.ml_line_count;
|
curwin->w_topline = curbuf->b_ml.ml_line_count;
|
||||||
curwin->w_cursor.lnum = curwin->w_topline;
|
curwin->w_cursor.lnum = curwin->w_topline;
|
||||||
curwin->w_cursor.col = 0;
|
curwin->w_cursor.col = 0;
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
if (use_popup != USEPOPUP_NONE)
|
if (use_popup != USEPOPUP_NONE)
|
||||||
{
|
{
|
||||||
pum_position_info_popup(curwin);
|
pum_position_info_popup(curwin);
|
||||||
@ -916,13 +916,13 @@ pum_set_selected(int n, int repeat UNUSED)
|
|||||||
|
|
||||||
if (!resized && win_valid(curwin_save))
|
if (!resized && win_valid(curwin_save))
|
||||||
{
|
{
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
win_T *wp = curwin;
|
win_T *wp = curwin;
|
||||||
# endif
|
# endif
|
||||||
++no_u_sync;
|
++no_u_sync;
|
||||||
win_enter(curwin_save, TRUE);
|
win_enter(curwin_save, TRUE);
|
||||||
--no_u_sync;
|
--no_u_sync;
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
if (use_popup == USEPOPUP_HIDDEN && win_valid(wp))
|
if (use_popup == USEPOPUP_HIDDEN && win_valid(wp))
|
||||||
popup_hide(wp);
|
popup_hide(wp);
|
||||||
# endif
|
# endif
|
||||||
@ -937,7 +937,7 @@ pum_set_selected(int n, int repeat UNUSED)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX)
|
# if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
|
||||||
if (WIN_IS_POPUP(curwin))
|
if (WIN_IS_POPUP(curwin))
|
||||||
// can't keep focus in a popup window
|
// can't keep focus in a popup window
|
||||||
win_enter(firstwin, TRUE);
|
win_enter(firstwin, TRUE);
|
||||||
@ -945,7 +945,7 @@ pum_set_selected(int n, int repeat UNUSED)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX)
|
#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
|
||||||
if (!has_info)
|
if (!has_info)
|
||||||
// hide any popup info window
|
// hide any popup info window
|
||||||
popup_hide_info();
|
popup_hide_info();
|
||||||
@ -967,7 +967,7 @@ pum_undisplay(void)
|
|||||||
redraw_all_later(NOT_VALID);
|
redraw_all_later(NOT_VALID);
|
||||||
redraw_tabline = TRUE;
|
redraw_tabline = TRUE;
|
||||||
status_redraw_all();
|
status_redraw_all();
|
||||||
#if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX)
|
#if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
|
||||||
// hide any popup info window
|
// hide any popup info window
|
||||||
popup_hide_info();
|
popup_hide_info();
|
||||||
#endif
|
#endif
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "vim.h"
|
#include "vim.h"
|
||||||
|
|
||||||
#if defined(FEAT_TEXT_PROP) || defined(PROTO)
|
#if defined(FEAT_PROP_POPUP) || defined(PROTO)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *pp_name;
|
char *pp_name;
|
||||||
@ -3864,4 +3864,4 @@ popup_update_preview_title(void)
|
|||||||
popup_set_title(wp);
|
popup_set_title(wp);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FEAT_TEXT_PROP
|
#endif // FEAT_PROP_POPUP
|
||||||
|
@ -216,7 +216,7 @@ void mbyte_im_set_active(int active_arg);
|
|||||||
# if defined(HAVE_TGETENT) && (defined(AMIGA) || defined(VMS))
|
# if defined(HAVE_TGETENT) && (defined(AMIGA) || defined(VMS))
|
||||||
# include "termlib.pro"
|
# include "termlib.pro"
|
||||||
# endif
|
# endif
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
# include "popupwin.pro"
|
# include "popupwin.pro"
|
||||||
# include "textprop.pro"
|
# include "textprop.pro"
|
||||||
# endif
|
# endif
|
||||||
@ -257,7 +257,7 @@ void mbyte_im_set_active(int active_arg);
|
|||||||
# ifndef FEAT_BEVAL
|
# ifndef FEAT_BEVAL
|
||||||
# define BalloonEval int
|
# define BalloonEval int
|
||||||
# endif
|
# endif
|
||||||
# if defined(FEAT_BEVAL) || defined(FEAT_TEXT_PROP)
|
# if defined(FEAT_BEVAL) || defined(FEAT_PROP_POPUP)
|
||||||
# include "beval.pro"
|
# include "beval.pro"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
44
src/screen.c
44
src/screen.c
@ -108,7 +108,7 @@ get_wcr_attr(win_T *wp)
|
|||||||
|
|
||||||
if (*wp->w_p_wcr != NUL)
|
if (*wp->w_p_wcr != NUL)
|
||||||
wcr_attr = syn_name2attr(wp->w_p_wcr);
|
wcr_attr = syn_name2attr(wp->w_p_wcr);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
else if (WIN_IS_POPUP(wp))
|
else if (WIN_IS_POPUP(wp))
|
||||||
{
|
{
|
||||||
if (wp->w_popup_flags & POPF_INFO)
|
if (wp->w_popup_flags & POPF_INFO)
|
||||||
@ -348,7 +348,7 @@ screen_get_current_line_off()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
/*
|
/*
|
||||||
* Return TRUE if this position has a higher level popup or this cell is
|
* Return TRUE if this position has a higher level popup or this cell is
|
||||||
* transparent in the current popup.
|
* transparent in the current popup.
|
||||||
@ -460,7 +460,7 @@ screen_line(
|
|||||||
}
|
}
|
||||||
#endif /* FEAT_RIGHTLEFT */
|
#endif /* FEAT_RIGHTLEFT */
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// First char of a popup window may go on top of the right half of a
|
// First char of a popup window may go on top of the right half of a
|
||||||
// double-wide character. Clear the left half to avoid it getting the popup
|
// double-wide character. Clear the left half to avoid it getting the popup
|
||||||
// window background color.
|
// window background color.
|
||||||
@ -499,7 +499,7 @@ screen_line(
|
|||||||
redraw_this = TRUE;
|
redraw_this = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (blocked_by_popup(row, col + coloff))
|
if (blocked_by_popup(row, col + coloff))
|
||||||
redraw_this = FALSE;
|
redraw_this = FALSE;
|
||||||
#endif
|
#endif
|
||||||
@ -744,7 +744,7 @@ screen_line(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (clear_width > 0
|
if (clear_width > 0
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
&& !(flags & SLF_POPUP) // no separator for popup window
|
&& !(flags & SLF_POPUP) // no separator for popup window
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -753,7 +753,7 @@ screen_line(
|
|||||||
// right of the window contents. But not on top of a popup window.
|
// right of the window contents. But not on top of a popup window.
|
||||||
if (coloff + col < Columns)
|
if (coloff + col < Columns)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (!blocked_by_popup(row, col + coloff))
|
if (!blocked_by_popup(row, col + coloff))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -1586,7 +1586,7 @@ screen_puts_len(
|
|||||||
|| exmode_active;
|
|| exmode_active;
|
||||||
|
|
||||||
if ((need_redraw || force_redraw_this)
|
if ((need_redraw || force_redraw_this)
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
&& !blocked_by_popup(row, col)
|
&& !blocked_by_popup(row, col)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -2031,12 +2031,12 @@ screen_char(unsigned off, int row, int col)
|
|||||||
// Skip if under the popup menu.
|
// Skip if under the popup menu.
|
||||||
// Popup windows with zindex higher than POPUPMENU_ZINDEX go on top.
|
// Popup windows with zindex higher than POPUPMENU_ZINDEX go on top.
|
||||||
if (pum_under_menu(row, col)
|
if (pum_under_menu(row, col)
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
&& screen_zindex <= POPUPMENU_ZINDEX
|
&& screen_zindex <= POPUPMENU_ZINDEX
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (blocked_by_popup(row, col))
|
if (blocked_by_popup(row, col))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
@ -2338,7 +2338,7 @@ screen_fill(
|
|||||||
|| force_next
|
|| force_next
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// Skip if under a(nother) popup.
|
// Skip if under a(nother) popup.
|
||||||
&& !blocked_by_popup(row, col)
|
&& !blocked_by_popup(row, col)
|
||||||
#endif
|
#endif
|
||||||
@ -2479,7 +2479,7 @@ screenalloc(int doclear)
|
|||||||
unsigned *new_LineOffset;
|
unsigned *new_LineOffset;
|
||||||
char_u *new_LineWraps;
|
char_u *new_LineWraps;
|
||||||
short *new_TabPageIdxs;
|
short *new_TabPageIdxs;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
short *new_popup_mask;
|
short *new_popup_mask;
|
||||||
short *new_popup_mask_next;
|
short *new_popup_mask_next;
|
||||||
char *new_popup_transparent;
|
char *new_popup_transparent;
|
||||||
@ -2540,7 +2540,7 @@ retry:
|
|||||||
win_free_lsize(wp);
|
win_free_lsize(wp);
|
||||||
if (aucmd_win != NULL)
|
if (aucmd_win != NULL)
|
||||||
win_free_lsize(aucmd_win);
|
win_free_lsize(aucmd_win);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// global popup windows
|
// global popup windows
|
||||||
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
||||||
win_free_lsize(wp);
|
win_free_lsize(wp);
|
||||||
@ -2565,7 +2565,7 @@ retry:
|
|||||||
new_LineOffset = LALLOC_MULT(unsigned, Rows);
|
new_LineOffset = LALLOC_MULT(unsigned, Rows);
|
||||||
new_LineWraps = LALLOC_MULT(char_u, Rows);
|
new_LineWraps = LALLOC_MULT(char_u, Rows);
|
||||||
new_TabPageIdxs = LALLOC_MULT(short, Columns);
|
new_TabPageIdxs = LALLOC_MULT(short, Columns);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
new_popup_mask = LALLOC_MULT(short, Rows * Columns);
|
new_popup_mask = LALLOC_MULT(short, Rows * Columns);
|
||||||
new_popup_mask_next = LALLOC_MULT(short, Rows * Columns);
|
new_popup_mask_next = LALLOC_MULT(short, Rows * Columns);
|
||||||
new_popup_transparent = LALLOC_MULT(char, Rows * Columns);
|
new_popup_transparent = LALLOC_MULT(char, Rows * Columns);
|
||||||
@ -2582,7 +2582,7 @@ retry:
|
|||||||
if (aucmd_win != NULL && aucmd_win->w_lines == NULL
|
if (aucmd_win != NULL && aucmd_win->w_lines == NULL
|
||||||
&& win_alloc_lines(aucmd_win) == FAIL)
|
&& win_alloc_lines(aucmd_win) == FAIL)
|
||||||
outofmem = TRUE;
|
outofmem = TRUE;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// global popup windows
|
// global popup windows
|
||||||
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
||||||
if (win_alloc_lines(wp) == FAIL)
|
if (win_alloc_lines(wp) == FAIL)
|
||||||
@ -2612,7 +2612,7 @@ give_up:
|
|||||||
|| new_LineOffset == NULL
|
|| new_LineOffset == NULL
|
||||||
|| new_LineWraps == NULL
|
|| new_LineWraps == NULL
|
||||||
|| new_TabPageIdxs == NULL
|
|| new_TabPageIdxs == NULL
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
|| new_popup_mask == NULL
|
|| new_popup_mask == NULL
|
||||||
|| new_popup_mask_next == NULL
|
|| new_popup_mask_next == NULL
|
||||||
|| new_popup_transparent == NULL
|
|| new_popup_transparent == NULL
|
||||||
@ -2637,7 +2637,7 @@ give_up:
|
|||||||
VIM_CLEAR(new_LineOffset);
|
VIM_CLEAR(new_LineOffset);
|
||||||
VIM_CLEAR(new_LineWraps);
|
VIM_CLEAR(new_LineWraps);
|
||||||
VIM_CLEAR(new_TabPageIdxs);
|
VIM_CLEAR(new_TabPageIdxs);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
VIM_CLEAR(new_popup_mask);
|
VIM_CLEAR(new_popup_mask);
|
||||||
VIM_CLEAR(new_popup_mask_next);
|
VIM_CLEAR(new_popup_mask_next);
|
||||||
VIM_CLEAR(new_popup_transparent);
|
VIM_CLEAR(new_popup_transparent);
|
||||||
@ -2715,7 +2715,7 @@ give_up:
|
|||||||
/* Use the last line of the screen for the current line. */
|
/* Use the last line of the screen for the current line. */
|
||||||
current_ScreenLine = new_ScreenLines + Rows * Columns;
|
current_ScreenLine = new_ScreenLines + Rows * Columns;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
vim_memset(new_popup_mask, 0, Rows * Columns * sizeof(short));
|
vim_memset(new_popup_mask, 0, Rows * Columns * sizeof(short));
|
||||||
vim_memset(new_popup_transparent, 0, Rows * Columns * sizeof(char));
|
vim_memset(new_popup_transparent, 0, Rows * Columns * sizeof(char));
|
||||||
#endif
|
#endif
|
||||||
@ -2734,7 +2734,7 @@ give_up:
|
|||||||
LineOffset = new_LineOffset;
|
LineOffset = new_LineOffset;
|
||||||
LineWraps = new_LineWraps;
|
LineWraps = new_LineWraps;
|
||||||
TabPageIdxs = new_TabPageIdxs;
|
TabPageIdxs = new_TabPageIdxs;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
popup_mask = new_popup_mask;
|
popup_mask = new_popup_mask;
|
||||||
popup_mask_next = new_popup_mask_next;
|
popup_mask_next = new_popup_mask_next;
|
||||||
popup_transparent = new_popup_transparent;
|
popup_transparent = new_popup_transparent;
|
||||||
@ -2803,7 +2803,7 @@ free_screenlines(void)
|
|||||||
VIM_CLEAR(LineOffset);
|
VIM_CLEAR(LineOffset);
|
||||||
VIM_CLEAR(LineWraps);
|
VIM_CLEAR(LineWraps);
|
||||||
VIM_CLEAR(TabPageIdxs);
|
VIM_CLEAR(TabPageIdxs);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
VIM_CLEAR(popup_mask);
|
VIM_CLEAR(popup_mask);
|
||||||
VIM_CLEAR(popup_mask_next);
|
VIM_CLEAR(popup_mask_next);
|
||||||
VIM_CLEAR(popup_transparent);
|
VIM_CLEAR(popup_transparent);
|
||||||
@ -2948,7 +2948,7 @@ can_clear(char_u *p)
|
|||||||
|| cterm_normal_bg_color == 0
|
|| cterm_normal_bg_color == 0
|
||||||
#endif
|
#endif
|
||||||
|| *T_UT != NUL)
|
|| *T_UT != NUL)
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
&& !(p == T_CE && popup_visible)
|
&& !(p == T_CE && popup_visible)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
@ -3412,7 +3412,7 @@ win_do_lines(
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// this doesn't work when there are popups visible
|
// this doesn't work when there are popups visible
|
||||||
if (popup_visible)
|
if (popup_visible)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@ -3544,7 +3544,7 @@ screen_ins_lines(
|
|||||||
|| (clip_star.state != SELECT_CLEARED
|
|| (clip_star.state != SELECT_CLEARED
|
||||||
&& redrawing_for_callback > 0)
|
&& redrawing_for_callback > 0)
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
|| popup_visible
|
|| popup_visible
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
|
@ -2863,7 +2863,7 @@ findsent(int dir, long count)
|
|||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* if on an empty line, skip upto a non-empty line
|
* if on an empty line, skip up to a non-empty line
|
||||||
*/
|
*/
|
||||||
if (gchar_pos(&pos) == NUL)
|
if (gchar_pos(&pos) == NUL)
|
||||||
{
|
{
|
||||||
@ -5724,7 +5724,7 @@ search_line:
|
|||||||
redraw_later(VALID);
|
redraw_later(VALID);
|
||||||
win_enter(curwin_save, TRUE);
|
win_enter(curwin_save, TRUE);
|
||||||
}
|
}
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
else if (WIN_IS_POPUP(curwin))
|
else if (WIN_IS_POPUP(curwin))
|
||||||
// can't keep focus in popup window
|
// can't keep focus in popup window
|
||||||
win_enter(firstwin, TRUE);
|
win_enter(firstwin, TRUE);
|
||||||
|
@ -496,7 +496,7 @@ buf_get_signattrs(win_T *wp, linenr_T lnum, sign_attrs_T *sattr)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (sign->se_lnum == lnum
|
if (sign->se_lnum == lnum
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
&& sign_group_for_window(sign, wp)
|
&& sign_group_for_window(sign, wp)
|
||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
@ -2656,7 +2656,7 @@ get_first_valid_sign(win_T *wp)
|
|||||||
{
|
{
|
||||||
sign_entry_T *sign = wp->w_buffer->b_signlist;
|
sign_entry_T *sign = wp->w_buffer->b_signlist;
|
||||||
|
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
while (sign != NULL && !sign_group_for_window(sign, wp))
|
while (sign != NULL && !sign_group_for_window(sign, wp))
|
||||||
sign = sign->se_next;
|
sign = sign->se_next;
|
||||||
# endif
|
# endif
|
||||||
|
@ -2119,7 +2119,7 @@ typedef struct {
|
|||||||
// # define CRYPT_NOT_INPLACE 1
|
// # define CRYPT_NOT_INPLACE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
typedef enum {
|
typedef enum {
|
||||||
POPPOS_BOTLEFT,
|
POPPOS_BOTLEFT,
|
||||||
POPPOS_TOPLEFT,
|
POPPOS_TOPLEFT,
|
||||||
@ -2615,7 +2615,7 @@ struct file_buffer
|
|||||||
listener_T *b_listener;
|
listener_T *b_listener;
|
||||||
list_T *b_recorded_changes;
|
list_T *b_recorded_changes;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
int b_has_textprop; // TRUE when text props were added
|
int b_has_textprop; // TRUE when text props were added
|
||||||
hashtab_T *b_proptypes; // text property types local to buffer
|
hashtab_T *b_proptypes; // text property types local to buffer
|
||||||
#endif
|
#endif
|
||||||
@ -2768,7 +2768,7 @@ struct tabpage_S
|
|||||||
win_T *tp_prevwin; // previous window in this Tab page
|
win_T *tp_prevwin; // previous window in this Tab page
|
||||||
win_T *tp_firstwin; // first window in this Tab page
|
win_T *tp_firstwin; // first window in this Tab page
|
||||||
win_T *tp_lastwin; // last window in this Tab page
|
win_T *tp_lastwin; // last window in this Tab page
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
win_T *tp_first_popupwin; // first popup window in this Tab page
|
win_T *tp_first_popupwin; // first popup window in this Tab page
|
||||||
#endif
|
#endif
|
||||||
long tp_old_Rows; // Rows when Tab page was left
|
long tp_old_Rows; // Rows when Tab page was left
|
||||||
@ -3020,7 +3020,7 @@ struct window_S
|
|||||||
int w_width; // Width of window, excluding separation.
|
int w_width; // Width of window, excluding separation.
|
||||||
int w_vsep_width; // Number of separator columns (0 or 1).
|
int w_vsep_width; // Number of separator columns (0 or 1).
|
||||||
pos_save_T w_save_cursor; // backup of cursor pos and topline
|
pos_save_T w_save_cursor; // backup of cursor pos and topline
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
int w_popup_flags; // POPF_ values
|
int w_popup_flags; // POPF_ values
|
||||||
int w_popup_handled; // POPUP_HANDLE[0-9] flags
|
int w_popup_handled; // POPUP_HANDLE[0-9] flags
|
||||||
char_u *w_popup_title;
|
char_u *w_popup_title;
|
||||||
|
@ -3678,7 +3678,7 @@ jumpto_tag(
|
|||||||
win_close(curwin, FALSE);
|
win_close(curwin, FALSE);
|
||||||
postponed_split = 0;
|
postponed_split = 0;
|
||||||
}
|
}
|
||||||
#if defined(FEAT_QUICKFIX) && defined(FEAT_TEXT_PROP)
|
#if defined(FEAT_QUICKFIX) && defined(FEAT_PROP_POPUP)
|
||||||
else if (WIN_IS_POPUP(curwin))
|
else if (WIN_IS_POPUP(curwin))
|
||||||
{
|
{
|
||||||
win_T *wp = curwin;
|
win_T *wp = curwin;
|
||||||
@ -3689,7 +3689,7 @@ jumpto_tag(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(FEAT_QUICKFIX) && defined(FEAT_TEXT_PROP)
|
#if defined(FEAT_QUICKFIX) && defined(FEAT_PROP_POPUP)
|
||||||
if (WIN_IS_POPUP(curwin))
|
if (WIN_IS_POPUP(curwin))
|
||||||
// something went wrong, still in popup, but it can't have focus
|
// something went wrong, still in popup, but it can't have focus
|
||||||
win_enter(firstwin, TRUE);
|
win_enter(firstwin, TRUE);
|
||||||
|
@ -177,7 +177,7 @@ func RunTheTest(test)
|
|||||||
au SwapExists * call HandleSwapExists()
|
au SwapExists * call HandleSwapExists()
|
||||||
|
|
||||||
" Close any stray popup windows
|
" Close any stray popup windows
|
||||||
if has('textprop')
|
if has('popupwin')
|
||||||
call popup_clear()
|
call popup_clear()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ func Test_win_execute()
|
|||||||
let line = win_execute(otherwin, 'echo getline(1)')
|
let line = win_execute(otherwin, 'echo getline(1)')
|
||||||
call assert_match('the new window', line)
|
call assert_match('the new window', line)
|
||||||
|
|
||||||
if has('textprop')
|
if has('popupwin')
|
||||||
let popupwin = popup_create('the popup win', {'line': 2, 'col': 3})
|
let popupwin = popup_create('the popup win', {'line': 2, 'col': 3})
|
||||||
redraw
|
redraw
|
||||||
let line = 'echo getline(1)'->win_execute(popupwin)
|
let line = 'echo getline(1)'->win_execute(popupwin)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" Tests for popup windows
|
" Tests for popup windows
|
||||||
|
|
||||||
source check.vim
|
source check.vim
|
||||||
CheckFeature textprop
|
CheckFeature popupwin
|
||||||
|
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
" Tests for popup windows for text properties
|
" Tests for popup windows for text properties
|
||||||
|
|
||||||
source check.vim
|
source check.vim
|
||||||
|
CheckFeature popupwin
|
||||||
CheckFeature textprop
|
CheckFeature textprop
|
||||||
|
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "vim.h"
|
#include "vim.h"
|
||||||
|
|
||||||
#if defined(FEAT_TEXT_PROP) || defined(PROTO)
|
#if defined(FEAT_PROP_POPUP) || defined(PROTO)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In a hashtable item "hi_key" points to "pt_name" in a proptype_T.
|
* In a hashtable item "hi_key" points to "pt_name" in a proptype_T.
|
||||||
@ -1309,4 +1309,4 @@ join_prop_lines(
|
|||||||
vim_free(prop_lengths);
|
vim_free(prop_lengths);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FEAT_TEXT_PROP
|
#endif // FEAT_PROP_POPUP
|
||||||
|
20
src/ui.c
20
src/ui.c
@ -1079,7 +1079,7 @@ clip_compare_pos(
|
|||||||
clip_start_selection(int col, int row, int repeated_click)
|
clip_start_selection(int col, int row, int repeated_click)
|
||||||
{
|
{
|
||||||
Clipboard_T *cb = &clip_star;
|
Clipboard_T *cb = &clip_star;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
int row_cp = row;
|
int row_cp = row;
|
||||||
int col_cp = col;
|
int col_cp = col;
|
||||||
@ -1103,7 +1103,7 @@ clip_start_selection(int col, int row, int repeated_click)
|
|||||||
cb->end = cb->start;
|
cb->end = cb->start;
|
||||||
cb->origin_row = (short_u)cb->start.lnum;
|
cb->origin_row = (short_u)cb->start.lnum;
|
||||||
cb->state = SELECT_IN_PROGRESS;
|
cb->state = SELECT_IN_PROGRESS;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (wp != NULL && WIN_IS_POPUP(wp))
|
if (wp != NULL && WIN_IS_POPUP(wp))
|
||||||
{
|
{
|
||||||
// Click in a popup window restricts selection to that window,
|
// Click in a popup window restricts selection to that window,
|
||||||
@ -1455,7 +1455,7 @@ clip_invert_area(
|
|||||||
int invert = FALSE;
|
int invert = FALSE;
|
||||||
int max_col;
|
int max_col;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
max_col = cbd->max_col - 1;
|
max_col = cbd->max_col - 1;
|
||||||
#else
|
#else
|
||||||
max_col = Columns - 1;
|
max_col = Columns - 1;
|
||||||
@ -1526,7 +1526,7 @@ clip_invert_rectangle(
|
|||||||
int height = height_arg;
|
int height = height_arg;
|
||||||
int width = width_arg;
|
int width = width_arg;
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// this goes on top of all popup windows
|
// this goes on top of all popup windows
|
||||||
screen_zindex = CLIP_ZINDEX;
|
screen_zindex = CLIP_ZINDEX;
|
||||||
|
|
||||||
@ -1551,7 +1551,7 @@ clip_invert_rectangle(
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
screen_draw_rectangle(row, col, height, width, invert);
|
screen_draw_rectangle(row, col, height, width, invert);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
screen_zindex = 0;
|
screen_zindex = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1594,7 +1594,7 @@ clip_copy_modeless_selection(int both UNUSED)
|
|||||||
{
|
{
|
||||||
row = col1; col1 = col2; col2 = row;
|
row = col1; col1 = col2; col2 = row;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (col1 < clip_star.min_col)
|
if (col1 < clip_star.min_col)
|
||||||
col1 = clip_star.min_col;
|
col1 = clip_star.min_col;
|
||||||
if (col2 > clip_star.max_col)
|
if (col2 > clip_star.max_col)
|
||||||
@ -1629,7 +1629,7 @@ clip_copy_modeless_selection(int both UNUSED)
|
|||||||
if (row == row1)
|
if (row == row1)
|
||||||
start_col = col1;
|
start_col = col1;
|
||||||
else
|
else
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
start_col = clip_star.min_col;
|
start_col = clip_star.min_col;
|
||||||
#else
|
#else
|
||||||
start_col = 0;
|
start_col = 0;
|
||||||
@ -1638,7 +1638,7 @@ clip_copy_modeless_selection(int both UNUSED)
|
|||||||
if (row == row2)
|
if (row == row2)
|
||||||
end_col = col2;
|
end_col = col2;
|
||||||
else
|
else
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
end_col = clip_star.max_col;
|
end_col = clip_star.max_col;
|
||||||
#else
|
#else
|
||||||
end_col = Columns;
|
end_col = Columns;
|
||||||
@ -1648,7 +1648,7 @@ clip_copy_modeless_selection(int both UNUSED)
|
|||||||
|
|
||||||
/* See if we need to nuke some trailing whitespace */
|
/* See if we need to nuke some trailing whitespace */
|
||||||
if (end_col >=
|
if (end_col >=
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
clip_star.max_col
|
clip_star.max_col
|
||||||
#else
|
#else
|
||||||
Columns
|
Columns
|
||||||
@ -1814,7 +1814,7 @@ clip_get_line_end(Clipboard_T *cbd UNUSED, int row)
|
|||||||
if (row >= screen_Rows || ScreenLines == NULL)
|
if (row >= screen_Rows || ScreenLines == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
for (i =
|
for (i =
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
cbd->max_col;
|
cbd->max_col;
|
||||||
#else
|
#else
|
||||||
screen_Columns;
|
screen_Columns;
|
||||||
|
@ -472,6 +472,11 @@ static char *(features[]) =
|
|||||||
#else
|
#else
|
||||||
"-persistent_undo",
|
"-persistent_undo",
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef FEAT_PROP_POPUP
|
||||||
|
"+popupwin",
|
||||||
|
#else
|
||||||
|
"-popupwin",
|
||||||
|
#endif
|
||||||
#ifdef FEAT_PRINTER
|
#ifdef FEAT_PRINTER
|
||||||
# ifdef FEAT_POSTSCRIPT
|
# ifdef FEAT_POSTSCRIPT
|
||||||
"+postscript",
|
"+postscript",
|
||||||
@ -614,7 +619,7 @@ static char *(features[]) =
|
|||||||
#else
|
#else
|
||||||
"-textobjects",
|
"-textobjects",
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
"+textprop",
|
"+textprop",
|
||||||
#else
|
#else
|
||||||
"-textprop",
|
"-textprop",
|
||||||
@ -737,6 +742,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2371,
|
||||||
/**/
|
/**/
|
||||||
2370,
|
2370,
|
||||||
/**/
|
/**/
|
||||||
|
@ -653,7 +653,7 @@ extern int (*dyn_libintl_wputenv)(const wchar_t *envstring);
|
|||||||
#define POPUP_HANDLED_4 0x08 // used by may_update_popup_mask()
|
#define POPUP_HANDLED_4 0x08 // used by may_update_popup_mask()
|
||||||
#define POPUP_HANDLED_5 0x10 // used by update_popups()
|
#define POPUP_HANDLED_5 0x10 // used by update_popups()
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
# define WIN_IS_POPUP(wp) ((wp)->w_popup_flags != 0)
|
# define WIN_IS_POPUP(wp) ((wp)->w_popup_flags != 0)
|
||||||
#else
|
#else
|
||||||
# define WIN_IS_POPUP(wp) 0
|
# define WIN_IS_POPUP(wp) 0
|
||||||
@ -2072,7 +2072,7 @@ typedef struct
|
|||||||
short_u origin_end_col;
|
short_u origin_end_col;
|
||||||
short_u word_start_col;
|
short_u word_start_col;
|
||||||
short_u word_end_col;
|
short_u word_end_col;
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
// limits for selection inside a popup window
|
// limits for selection inside a popup window
|
||||||
short_u min_col;
|
short_u min_col;
|
||||||
short_u max_col;
|
short_u max_col;
|
||||||
|
16
src/window.c
16
src/window.c
@ -1426,7 +1426,7 @@ win_init_some(win_T *newp, win_T *oldp)
|
|||||||
int
|
int
|
||||||
win_valid_popup(win_T *win UNUSED)
|
win_valid_popup(win_T *win UNUSED)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
|
|
||||||
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
||||||
@ -1473,7 +1473,7 @@ win_valid_any_tab(win_T *win)
|
|||||||
if (wp == win)
|
if (wp == win)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
||||||
if (wp == win)
|
if (wp == win)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -2525,7 +2525,7 @@ win_close(win_T *win, int free_buf)
|
|||||||
out_flush();
|
out_flush();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if (popup_win_closed(win) && !win_valid(win))
|
if (popup_win_closed(win) && !win_valid(win))
|
||||||
return FAIL;
|
return FAIL;
|
||||||
#endif
|
#endif
|
||||||
@ -2761,7 +2761,7 @@ win_free_all(void)
|
|||||||
(void)win_free_mem(aucmd_win, &dummy, NULL);
|
(void)win_free_mem(aucmd_win, &dummy, NULL);
|
||||||
aucmd_win = NULL;
|
aucmd_win = NULL;
|
||||||
}
|
}
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
close_all_popups();
|
close_all_popups();
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -3778,7 +3778,7 @@ free_tabpage(tabpage_T *tp)
|
|||||||
# ifdef FEAT_DIFF
|
# ifdef FEAT_DIFF
|
||||||
diff_clear(tp);
|
diff_clear(tp);
|
||||||
# endif
|
# endif
|
||||||
# ifdef FEAT_TEXT_PROP
|
# ifdef FEAT_PROP_POPUP
|
||||||
while (tp->tp_first_popupwin != NULL)
|
while (tp->tp_first_popupwin != NULL)
|
||||||
popup_close_tabpage(tp, tp->tp_first_popupwin->w_id);
|
popup_close_tabpage(tp, tp->tp_first_popupwin->w_id);
|
||||||
#endif
|
#endif
|
||||||
@ -4686,7 +4686,7 @@ win_enter_ext(
|
|||||||
|
|
||||||
/* set window height to desired minimal value */
|
/* set window height to desired minimal value */
|
||||||
if (curwin->w_height < p_wh && !curwin->w_p_wfh
|
if (curwin->w_height < p_wh && !curwin->w_p_wfh
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
&& !popup_is_popup(curwin)
|
&& !popup_is_popup(curwin)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -4952,7 +4952,7 @@ win_free(
|
|||||||
#ifdef FEAT_MENU
|
#ifdef FEAT_MENU
|
||||||
remove_winbar(wp);
|
remove_winbar(wp);
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_PROP_POPUP
|
||||||
free_callback(&wp->w_close_cb);
|
free_callback(&wp->w_close_cb);
|
||||||
free_callback(&wp->w_filter_cb);
|
free_callback(&wp->w_filter_cb);
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
@ -4991,7 +4991,7 @@ win_unlisted(win_T *wp)
|
|||||||
return wp == aucmd_win || WIN_IS_POPUP(wp);
|
return wp == aucmd_win || WIN_IS_POPUP(wp);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_TEXT_PROP) || defined(PROTO)
|
#if defined(FEAT_PROP_POPUP) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Free a popup window. This does not take the window out of the window list
|
* Free a popup window. This does not take the window out of the window list
|
||||||
* and assumes there is only one toplevel frame, no split.
|
* and assumes there is only one toplevel frame, no split.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user