mirror of
https://github.com/vim/vim.git
synced 2025-08-30 20:43:35 -04:00
patch 9.0.1221: code is indented more than necessary
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11833)
This commit is contained in:
parent
4aecaa168e
commit
f97a295cca
@ -1367,13 +1367,13 @@ failed:
|
|||||||
void
|
void
|
||||||
ui_remove_balloon(void)
|
ui_remove_balloon(void)
|
||||||
{
|
{
|
||||||
if (balloon_array != NULL)
|
if (balloon_array == NULL)
|
||||||
{
|
return;
|
||||||
pum_undisplay();
|
|
||||||
while (balloon_arraysize > 0)
|
pum_undisplay();
|
||||||
vim_free(balloon_array[--balloon_arraysize].pum_text);
|
while (balloon_arraysize > 0)
|
||||||
VIM_CLEAR(balloon_array);
|
vim_free(balloon_array[--balloon_arraysize].pum_text);
|
||||||
}
|
VIM_CLEAR(balloon_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1410,19 +1410,19 @@ ui_post_balloon(char_u *mesg, list_T *list)
|
|||||||
else
|
else
|
||||||
balloon_arraysize = split_message(mesg, &balloon_array);
|
balloon_arraysize = split_message(mesg, &balloon_array);
|
||||||
|
|
||||||
if (balloon_arraysize > 0)
|
if (balloon_arraysize <= 0)
|
||||||
{
|
return;
|
||||||
pum_array = balloon_array;
|
|
||||||
pum_size = balloon_arraysize;
|
|
||||||
pum_compute_size();
|
|
||||||
pum_scrollbar = 0;
|
|
||||||
pum_height = balloon_arraysize;
|
|
||||||
|
|
||||||
pum_position_at_mouse(BALLOON_MIN_WIDTH);
|
pum_array = balloon_array;
|
||||||
pum_selected = -1;
|
pum_size = balloon_arraysize;
|
||||||
pum_first = 0;
|
pum_compute_size();
|
||||||
pum_redraw();
|
pum_scrollbar = 0;
|
||||||
}
|
pum_height = balloon_arraysize;
|
||||||
|
|
||||||
|
pum_position_at_mouse(BALLOON_MIN_WIDTH);
|
||||||
|
pum_selected = -1;
|
||||||
|
pum_first = 0;
|
||||||
|
pum_redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
759
src/popupwin.c
759
src/popupwin.c
@ -98,31 +98,32 @@ set_padding_border(dict_T *dict, int *array, char *name, int max_val)
|
|||||||
dictitem_T *di;
|
dictitem_T *di;
|
||||||
|
|
||||||
di = dict_find(dict, (char_u *)name, -1);
|
di = dict_find(dict, (char_u *)name, -1);
|
||||||
if (di != NULL)
|
if (di == NULL)
|
||||||
{
|
return;
|
||||||
if (di->di_tv.v_type != VAR_LIST)
|
|
||||||
emsg(_(e_list_required));
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list_T *list = di->di_tv.vval.v_list;
|
|
||||||
listitem_T *li;
|
|
||||||
int i;
|
|
||||||
int nr;
|
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i)
|
if (di->di_tv.v_type != VAR_LIST)
|
||||||
array[i] = 1;
|
{
|
||||||
if (list != NULL)
|
emsg(_(e_list_required));
|
||||||
{
|
return;
|
||||||
CHECK_LIST_MATERIALIZE(list);
|
}
|
||||||
for (i = 0, li = list->lv_first; i < 4 && i < list->lv_len;
|
|
||||||
++i, li = li->li_next)
|
list_T *list = di->di_tv.vval.v_list;
|
||||||
{
|
listitem_T *li;
|
||||||
nr = (int)tv_get_number(&li->li_tv);
|
int i;
|
||||||
if (nr >= 0)
|
int nr;
|
||||||
array[i] = nr > max_val ? max_val : nr;
|
|
||||||
}
|
for (i = 0; i < 4; ++i)
|
||||||
}
|
array[i] = 1;
|
||||||
}
|
if (list == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CHECK_LIST_MATERIALIZE(list);
|
||||||
|
for (i = 0, li = list->lv_first; i < 4 && i < list->lv_len;
|
||||||
|
++i, li = li->li_next)
|
||||||
|
{
|
||||||
|
nr = (int)tv_get_number(&li->li_tv);
|
||||||
|
if (nr >= 0)
|
||||||
|
array[i] = nr > max_val ? max_val : nr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,11 +148,11 @@ set_moved_columns(win_T *wp, int flags)
|
|||||||
char_u *ptr;
|
char_u *ptr;
|
||||||
int len = find_ident_under_cursor(&ptr, flags | FIND_NOERROR);
|
int len = find_ident_under_cursor(&ptr, flags | FIND_NOERROR);
|
||||||
|
|
||||||
if (len > 0)
|
if (len <= 0)
|
||||||
{
|
return;
|
||||||
wp->w_popup_mincol = (int)(ptr - ml_get_curline());
|
|
||||||
wp->w_popup_maxcol = wp->w_popup_mincol + len - 1;
|
wp->w_popup_mincol = (int)(ptr - ml_get_curline());
|
||||||
}
|
wp->w_popup_maxcol = wp->w_popup_mincol + len - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -169,23 +170,23 @@ set_mousemoved_values(win_T *wp)
|
|||||||
update_popup_uses_mouse_move(void)
|
update_popup_uses_mouse_move(void)
|
||||||
{
|
{
|
||||||
popup_uses_mouse_move = FALSE;
|
popup_uses_mouse_move = FALSE;
|
||||||
if (popup_visible)
|
if (!popup_visible)
|
||||||
{
|
return;
|
||||||
win_T *wp;
|
|
||||||
|
|
||||||
FOR_ALL_POPUPWINS(wp)
|
win_T *wp;
|
||||||
if (wp->w_popup_mouse_row != 0)
|
|
||||||
{
|
FOR_ALL_POPUPWINS(wp)
|
||||||
popup_uses_mouse_move = TRUE;
|
if (wp->w_popup_mouse_row != 0)
|
||||||
return;
|
{
|
||||||
}
|
popup_uses_mouse_move = TRUE;
|
||||||
FOR_ALL_POPUPWINS_IN_TAB(curtab, wp)
|
return;
|
||||||
if (wp->w_popup_mouse_row != 0)
|
}
|
||||||
{
|
FOR_ALL_POPUPWINS_IN_TAB(curtab, wp)
|
||||||
popup_uses_mouse_move = TRUE;
|
if (wp->w_popup_mouse_row != 0)
|
||||||
return;
|
{
|
||||||
}
|
popup_uses_mouse_move = TRUE;
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -201,19 +202,19 @@ set_mousemoved_columns(win_T *wp, int flags)
|
|||||||
colnr_T mcol;
|
colnr_T mcol;
|
||||||
|
|
||||||
if (find_word_under_cursor(mouse_row, mouse_col, TRUE, flags,
|
if (find_word_under_cursor(mouse_row, mouse_col, TRUE, flags,
|
||||||
&textwp, &pos.lnum, &text, NULL, &col) == OK)
|
&textwp, &pos.lnum, &text, NULL, &col) != OK)
|
||||||
{
|
return;
|
||||||
// convert text column to mouse column
|
|
||||||
pos.col = col;
|
|
||||||
pos.coladd = 0;
|
|
||||||
getvcol(textwp, &pos, &mcol, NULL, NULL);
|
|
||||||
wp->w_popup_mouse_mincol = mcol;
|
|
||||||
|
|
||||||
pos.col = col + (colnr_T)STRLEN(text) - 1;
|
// convert text column to mouse column
|
||||||
getvcol(textwp, &pos, NULL, NULL, &mcol);
|
pos.col = col;
|
||||||
wp->w_popup_mouse_maxcol = mcol;
|
pos.coladd = 0;
|
||||||
vim_free(text);
|
getvcol(textwp, &pos, &mcol, NULL, NULL);
|
||||||
}
|
wp->w_popup_mouse_mincol = mcol;
|
||||||
|
|
||||||
|
pos.col = col + (colnr_T)STRLEN(text) - 1;
|
||||||
|
getvcol(textwp, &pos, NULL, NULL, &mcol);
|
||||||
|
wp->w_popup_mouse_maxcol = mcol;
|
||||||
|
vim_free(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -390,40 +391,41 @@ popup_is_in_scrollbar(win_T *wp, int row, int col)
|
|||||||
void
|
void
|
||||||
popup_handle_scrollbar_click(win_T *wp, int row, int col)
|
popup_handle_scrollbar_click(win_T *wp, int row, int col)
|
||||||
{
|
{
|
||||||
if (popup_is_in_scrollbar(wp, row, col))
|
if (!popup_is_in_scrollbar(wp, row, col))
|
||||||
{
|
return;
|
||||||
int height = popup_height(wp);
|
|
||||||
int new_topline = wp->w_topline;
|
|
||||||
|
|
||||||
if (row >= height / 2)
|
int height = popup_height(wp);
|
||||||
|
int new_topline = wp->w_topline;
|
||||||
|
|
||||||
|
if (row >= height / 2)
|
||||||
|
{
|
||||||
|
// Click in lower half, scroll down.
|
||||||
|
if (wp->w_topline < wp->w_buffer->b_ml.ml_line_count)
|
||||||
|
++new_topline;
|
||||||
|
}
|
||||||
|
else if (wp->w_topline > 1)
|
||||||
|
// click on upper half, scroll up.
|
||||||
|
--new_topline;
|
||||||
|
|
||||||
|
if (new_topline == wp->w_topline)
|
||||||
|
return;
|
||||||
|
|
||||||
|
set_topline(wp, new_topline);
|
||||||
|
if (wp == curwin)
|
||||||
|
{
|
||||||
|
if (wp->w_cursor.lnum < wp->w_topline)
|
||||||
{
|
{
|
||||||
// Click in lower half, scroll down.
|
wp->w_cursor.lnum = wp->w_topline;
|
||||||
if (wp->w_topline < wp->w_buffer->b_ml.ml_line_count)
|
check_cursor();
|
||||||
++new_topline;
|
|
||||||
}
|
}
|
||||||
else if (wp->w_topline > 1)
|
else if (wp->w_cursor.lnum >= wp->w_botline)
|
||||||
// click on upper half, scroll up.
|
|
||||||
--new_topline;
|
|
||||||
if (new_topline != wp->w_topline)
|
|
||||||
{
|
{
|
||||||
set_topline(wp, new_topline);
|
wp->w_cursor.lnum = wp->w_botline - 1;
|
||||||
if (wp == curwin)
|
check_cursor();
|
||||||
{
|
|
||||||
if (wp->w_cursor.lnum < wp->w_topline)
|
|
||||||
{
|
|
||||||
wp->w_cursor.lnum = wp->w_topline;
|
|
||||||
check_cursor();
|
|
||||||
}
|
|
||||||
else if (wp->w_cursor.lnum >= wp->w_botline)
|
|
||||||
{
|
|
||||||
wp->w_cursor.lnum = wp->w_botline - 1;
|
|
||||||
check_cursor();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
popup_set_firstline(wp);
|
|
||||||
redraw_win_later(wp, UPD_NOT_VALID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
popup_set_firstline(wp);
|
||||||
|
redraw_win_later(wp, UPD_NOT_VALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_TIMERS)
|
#if defined(FEAT_TIMERS)
|
||||||
@ -441,18 +443,18 @@ popup_add_timeout(win_T *wp, int time, int close)
|
|||||||
vim_snprintf((char *)cbbuf, sizeof(cbbuf),
|
vim_snprintf((char *)cbbuf, sizeof(cbbuf),
|
||||||
close ? "(_) => popup_close(%d)" : "(_) => popup_hide(%d)",
|
close ? "(_) => popup_close(%d)" : "(_) => popup_hide(%d)",
|
||||||
wp->w_id);
|
wp->w_id);
|
||||||
if (get_lambda_tv_and_compile(&ptr, &tv, FALSE, &EVALARG_EVALUATE) == OK)
|
if (get_lambda_tv_and_compile(&ptr, &tv, FALSE, &EVALARG_EVALUATE) != OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wp->w_popup_timer = create_timer(time, 0);
|
||||||
|
callback_T cb = get_callback(&tv);
|
||||||
|
if (cb.cb_name != NULL && !cb.cb_free_name)
|
||||||
{
|
{
|
||||||
wp->w_popup_timer = create_timer(time, 0);
|
cb.cb_name = vim_strsave(cb.cb_name);
|
||||||
callback_T cb = get_callback(&tv);
|
cb.cb_free_name = TRUE;
|
||||||
if (cb.cb_name != NULL && !cb.cb_free_name)
|
|
||||||
{
|
|
||||||
cb.cb_name = vim_strsave(cb.cb_name);
|
|
||||||
cb.cb_free_name = TRUE;
|
|
||||||
}
|
|
||||||
wp->w_popup_timer->tr_callback = cb;
|
|
||||||
clear_tv(&tv);
|
|
||||||
}
|
}
|
||||||
|
wp->w_popup_timer->tr_callback = cb;
|
||||||
|
clear_tv(&tv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -619,16 +621,16 @@ check_highlight(dict_T *dict, char *name, char_u **pval)
|
|||||||
char_u *str;
|
char_u *str;
|
||||||
|
|
||||||
di = dict_find(dict, (char_u *)name, -1);
|
di = dict_find(dict, (char_u *)name, -1);
|
||||||
if (di != NULL)
|
if (di == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (di->di_tv.v_type != VAR_STRING)
|
||||||
|
semsg(_(e_invalid_value_for_argument_str), name);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (di->di_tv.v_type != VAR_STRING)
|
str = tv_get_string(&di->di_tv);
|
||||||
semsg(_(e_invalid_value_for_argument_str), name);
|
if (*str != NUL)
|
||||||
else
|
*pval = vim_strsave(str);
|
||||||
{
|
|
||||||
str = tv_get_string(&di->di_tv);
|
|
||||||
if (*str != NUL)
|
|
||||||
*pval = vim_strsave(str);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -990,18 +992,17 @@ apply_general_options(win_T *wp, dict_T *dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
di = dict_find(dict, (char_u *)"callback", -1);
|
di = dict_find(dict, (char_u *)"callback", -1);
|
||||||
if (di != NULL)
|
if (di == NULL)
|
||||||
{
|
return;
|
||||||
callback_T callback = get_callback(&di->di_tv);
|
|
||||||
|
|
||||||
if (callback.cb_name != NULL)
|
callback_T callback = get_callback(&di->di_tv);
|
||||||
{
|
if (callback.cb_name == NULL)
|
||||||
free_callback(&wp->w_close_cb);
|
return;
|
||||||
set_callback(&wp->w_close_cb, &callback);
|
|
||||||
if (callback.cb_free_name)
|
free_callback(&wp->w_close_cb);
|
||||||
vim_free(callback.cb_name);
|
set_callback(&wp->w_close_cb, &callback);
|
||||||
}
|
if (callback.cb_free_name)
|
||||||
}
|
vim_free(callback.cb_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2715,13 +2716,13 @@ popup_hide(win_T *wp)
|
|||||||
if (error_if_term_popup_window())
|
if (error_if_term_popup_window())
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
if ((wp->w_popup_flags & POPF_HIDDEN) == 0)
|
if ((wp->w_popup_flags & POPF_HIDDEN) != 0)
|
||||||
{
|
return;
|
||||||
wp->w_popup_flags |= POPF_HIDDEN;
|
|
||||||
// Do not decrement b_nwindows, we still reference the buffer.
|
wp->w_popup_flags |= POPF_HIDDEN;
|
||||||
redraw_all_later(UPD_NOT_VALID);
|
// Do not decrement b_nwindows, we still reference the buffer.
|
||||||
popup_mask_refresh = TRUE;
|
redraw_all_later(UPD_NOT_VALID);
|
||||||
}
|
popup_mask_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2738,22 +2739,22 @@ f_popup_hide(typval_T *argvars, typval_T *rettv UNUSED)
|
|||||||
|
|
||||||
id = (int)tv_get_number(argvars);
|
id = (int)tv_get_number(argvars);
|
||||||
wp = find_popup_win(id);
|
wp = find_popup_win(id);
|
||||||
if (wp != NULL)
|
if (wp == NULL)
|
||||||
{
|
return;
|
||||||
popup_hide(wp);
|
|
||||||
wp->w_popup_flags |= POPF_HIDDEN_FORCE;
|
popup_hide(wp);
|
||||||
}
|
wp->w_popup_flags |= POPF_HIDDEN_FORCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
popup_show(win_T *wp)
|
popup_show(win_T *wp)
|
||||||
{
|
{
|
||||||
if ((wp->w_popup_flags & POPF_HIDDEN) != 0)
|
if ((wp->w_popup_flags & POPF_HIDDEN) == 0)
|
||||||
{
|
return;
|
||||||
wp->w_popup_flags &= ~POPF_HIDDEN;
|
|
||||||
redraw_all_later(UPD_NOT_VALID);
|
wp->w_popup_flags &= ~POPF_HIDDEN;
|
||||||
popup_mask_refresh = TRUE;
|
redraw_all_later(UPD_NOT_VALID);
|
||||||
}
|
popup_mask_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2770,15 +2771,15 @@ f_popup_show(typval_T *argvars, typval_T *rettv UNUSED)
|
|||||||
|
|
||||||
id = (int)tv_get_number(argvars);
|
id = (int)tv_get_number(argvars);
|
||||||
wp = find_popup_win(id);
|
wp = find_popup_win(id);
|
||||||
if (wp != NULL)
|
if (wp == NULL)
|
||||||
{
|
return;
|
||||||
wp->w_popup_flags &= ~POPF_HIDDEN_FORCE;
|
|
||||||
popup_show(wp);
|
wp->w_popup_flags &= ~POPF_HIDDEN_FORCE;
|
||||||
|
popup_show(wp);
|
||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
if (wp->w_popup_flags & POPF_INFO)
|
if (wp->w_popup_flags & POPF_INFO)
|
||||||
pum_position_info_popup(wp);
|
pum_position_info_popup(wp);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2797,15 +2798,15 @@ f_popup_settext(typval_T *argvars, typval_T *rettv UNUSED)
|
|||||||
|
|
||||||
id = (int)tv_get_number(&argvars[0]);
|
id = (int)tv_get_number(&argvars[0]);
|
||||||
wp = find_popup_win(id);
|
wp = find_popup_win(id);
|
||||||
if (wp != NULL)
|
if (wp == NULL)
|
||||||
{
|
return;
|
||||||
if (check_for_string_or_list_arg(argvars, 1) != FAIL)
|
|
||||||
{
|
if (check_for_string_or_list_arg(argvars, 1) == FAIL)
|
||||||
popup_set_buffer_text(wp->w_buffer, argvars[1]);
|
return;
|
||||||
redraw_win_later(wp, UPD_NOT_VALID);
|
|
||||||
popup_adjust_position(wp);
|
popup_set_buffer_text(wp->w_buffer, argvars[1]);
|
||||||
}
|
redraw_win_later(wp, UPD_NOT_VALID);
|
||||||
}
|
popup_adjust_position(wp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3011,42 +3012,42 @@ f_popup_getpos(typval_T *argvars, typval_T *rettv)
|
|||||||
int top_extra;
|
int top_extra;
|
||||||
int left_extra;
|
int left_extra;
|
||||||
|
|
||||||
if (rettv_dict_alloc(rettv) == OK)
|
if (rettv_dict_alloc(rettv) == FAIL)
|
||||||
{
|
return;
|
||||||
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
id = (int)tv_get_number(argvars);
|
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
|
||||||
wp = find_popup_win(id);
|
return;
|
||||||
if (wp == NULL)
|
|
||||||
return; // invalid {id}
|
|
||||||
top_extra = popup_top_extra(wp);
|
|
||||||
left_extra = wp->w_popup_border[3] + wp->w_popup_padding[3];
|
|
||||||
|
|
||||||
// we know how much space we need, avoid resizing halfway
|
id = (int)tv_get_number(argvars);
|
||||||
dict = rettv->vval.v_dict;
|
wp = find_popup_win(id);
|
||||||
hash_lock_size(&dict->dv_hashtab, 11);
|
if (wp == NULL)
|
||||||
|
return; // invalid {id}
|
||||||
|
top_extra = popup_top_extra(wp);
|
||||||
|
left_extra = wp->w_popup_border[3] + wp->w_popup_padding[3];
|
||||||
|
|
||||||
dict_add_number(dict, "line", wp->w_winrow + 1);
|
// we know how much space we need, avoid resizing halfway
|
||||||
dict_add_number(dict, "col", wp->w_wincol + 1);
|
dict = rettv->vval.v_dict;
|
||||||
dict_add_number(dict, "width", wp->w_width + left_extra
|
hash_lock_size(&dict->dv_hashtab, 11);
|
||||||
+ wp->w_popup_border[1] + wp->w_popup_padding[1]);
|
|
||||||
dict_add_number(dict, "height", wp->w_height + top_extra
|
|
||||||
+ wp->w_popup_border[2] + wp->w_popup_padding[2]);
|
|
||||||
|
|
||||||
dict_add_number(dict, "core_line", wp->w_winrow + 1 + top_extra);
|
dict_add_number(dict, "line", wp->w_winrow + 1);
|
||||||
dict_add_number(dict, "core_col", wp->w_wincol + 1 + left_extra);
|
dict_add_number(dict, "col", wp->w_wincol + 1);
|
||||||
dict_add_number(dict, "core_width", wp->w_width);
|
dict_add_number(dict, "width", wp->w_width + left_extra
|
||||||
dict_add_number(dict, "core_height", wp->w_height);
|
+ wp->w_popup_border[1] + wp->w_popup_padding[1]);
|
||||||
|
dict_add_number(dict, "height", wp->w_height + top_extra
|
||||||
|
+ wp->w_popup_border[2] + wp->w_popup_padding[2]);
|
||||||
|
|
||||||
dict_add_number(dict, "scrollbar", wp->w_has_scrollbar);
|
dict_add_number(dict, "core_line", wp->w_winrow + 1 + top_extra);
|
||||||
dict_add_number(dict, "firstline", wp->w_topline);
|
dict_add_number(dict, "core_col", wp->w_wincol + 1 + left_extra);
|
||||||
dict_add_number(dict, "lastline", wp->w_botline - 1);
|
dict_add_number(dict, "core_width", wp->w_width);
|
||||||
dict_add_number(dict, "visible",
|
dict_add_number(dict, "core_height", wp->w_height);
|
||||||
win_valid(wp) && (wp->w_popup_flags & POPF_HIDDEN) == 0);
|
|
||||||
|
|
||||||
hash_unlock(&dict->dv_hashtab);
|
dict_add_number(dict, "scrollbar", wp->w_has_scrollbar);
|
||||||
}
|
dict_add_number(dict, "firstline", wp->w_topline);
|
||||||
|
dict_add_number(dict, "lastline", wp->w_botline - 1);
|
||||||
|
dict_add_number(dict, "visible",
|
||||||
|
win_valid(wp) && (wp->w_popup_flags & POPF_HIDDEN) == 0);
|
||||||
|
|
||||||
|
hash_unlock(&dict->dv_hashtab);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3102,13 +3103,13 @@ get_padding_border(dict_T *dict, int *array, char *name)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
list = list_alloc();
|
list = list_alloc();
|
||||||
if (list != NULL)
|
if (list == NULL)
|
||||||
{
|
return;
|
||||||
dict_add_list(dict, name, list);
|
|
||||||
if (array[0] != 1 || array[1] != 1 || array[2] != 1 || array[3] != 1)
|
dict_add_list(dict, name, list);
|
||||||
for (i = 0; i < 4; ++i)
|
if (array[0] != 1 || array[1] != 1 || array[2] != 1 || array[3] != 1)
|
||||||
list_append_number(list, array[i]);
|
for (i = 0; i < 4; ++i)
|
||||||
}
|
list_append_number(list, array[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3127,12 +3128,12 @@ get_borderhighlight(dict_T *dict, win_T *wp)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
list = list_alloc();
|
list = list_alloc();
|
||||||
if (list != NULL)
|
if (list == NULL)
|
||||||
{
|
return;
|
||||||
dict_add_list(dict, "borderhighlight", list);
|
|
||||||
for (i = 0; i < 4; ++i)
|
dict_add_list(dict, "borderhighlight", list);
|
||||||
list_append_string(list, wp->w_border_highlight[i], -1);
|
for (i = 0; i < 4; ++i)
|
||||||
}
|
list_append_string(list, wp->w_border_highlight[i], -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3153,14 +3154,14 @@ get_borderchars(dict_T *dict, win_T *wp)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
list = list_alloc();
|
list = list_alloc();
|
||||||
if (list != NULL)
|
if (list == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
dict_add_list(dict, "borderchars", list);
|
||||||
|
for (i = 0; i < 8; ++i)
|
||||||
{
|
{
|
||||||
dict_add_list(dict, "borderchars", list);
|
len = mb_char2bytes(wp->w_border_char[i], buf);
|
||||||
for (i = 0; i < 8; ++i)
|
list_append_string(list, buf, len);
|
||||||
{
|
|
||||||
len = mb_char2bytes(wp->w_border_char[i], buf);
|
|
||||||
list_append_string(list, buf, len);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3181,13 +3182,13 @@ get_moved_list(dict_T *dict, win_T *wp)
|
|||||||
list_append_number(list, wp->w_popup_maxcol);
|
list_append_number(list, wp->w_popup_maxcol);
|
||||||
}
|
}
|
||||||
list = list_alloc();
|
list = list_alloc();
|
||||||
if (list != NULL)
|
if (list == NULL)
|
||||||
{
|
return;
|
||||||
dict_add_list(dict, "mousemoved", list);
|
|
||||||
list_append_number(list, wp->w_popup_mouse_row);
|
dict_add_list(dict, "mousemoved", list);
|
||||||
list_append_number(list, wp->w_popup_mouse_mincol);
|
list_append_number(list, wp->w_popup_mouse_row);
|
||||||
list_append_number(list, wp->w_popup_mouse_maxcol);
|
list_append_number(list, wp->w_popup_mouse_mincol);
|
||||||
}
|
list_append_number(list, wp->w_popup_mouse_maxcol);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3202,104 +3203,104 @@ f_popup_getoptions(typval_T *argvars, typval_T *rettv)
|
|||||||
tabpage_T *tp;
|
tabpage_T *tp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (rettv_dict_alloc(rettv) == OK)
|
if (rettv_dict_alloc(rettv) == FAIL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
id = (int)tv_get_number(argvars);
|
||||||
|
wp = find_popup_win(id);
|
||||||
|
if (wp == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
dict = rettv->vval.v_dict;
|
||||||
|
dict_add_number(dict, "line", wp->w_wantline);
|
||||||
|
dict_add_number(dict, "col", wp->w_wantcol);
|
||||||
|
dict_add_number(dict, "minwidth", wp->w_minwidth);
|
||||||
|
dict_add_number(dict, "minheight", wp->w_minheight);
|
||||||
|
dict_add_number(dict, "maxheight", wp->w_maxheight);
|
||||||
|
dict_add_number(dict, "maxwidth", wp->w_maxwidth);
|
||||||
|
dict_add_number(dict, "firstline", wp->w_firstline);
|
||||||
|
dict_add_number(dict, "scrollbar", wp->w_want_scrollbar);
|
||||||
|
dict_add_number(dict, "zindex", wp->w_zindex);
|
||||||
|
dict_add_number(dict, "fixed", wp->w_popup_fixed);
|
||||||
|
if (wp->w_popup_prop_type && win_valid_any_tab(wp->w_popup_prop_win))
|
||||||
{
|
{
|
||||||
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
|
proptype_T *pt = text_prop_type_by_id(
|
||||||
return;
|
wp->w_popup_prop_win->w_buffer,
|
||||||
|
wp->w_popup_prop_type);
|
||||||
|
|
||||||
id = (int)tv_get_number(argvars);
|
if (pt != NULL)
|
||||||
wp = find_popup_win(id);
|
dict_add_string(dict, "textprop", pt->pt_name);
|
||||||
if (wp == NULL)
|
dict_add_number(dict, "textpropwin", wp->w_popup_prop_win->w_id);
|
||||||
return;
|
dict_add_number(dict, "textpropid", wp->w_popup_prop_id);
|
||||||
|
}
|
||||||
|
dict_add_string(dict, "title", wp->w_popup_title);
|
||||||
|
dict_add_number(dict, "wrap", wp->w_p_wrap);
|
||||||
|
dict_add_number(dict, "drag", (wp->w_popup_flags & POPF_DRAG) != 0);
|
||||||
|
dict_add_number(dict, "dragall",
|
||||||
|
(wp->w_popup_flags & POPF_DRAGALL) != 0);
|
||||||
|
dict_add_number(dict, "mapping",
|
||||||
|
(wp->w_popup_flags & POPF_MAPPING) != 0);
|
||||||
|
dict_add_number(dict, "resize", (wp->w_popup_flags & POPF_RESIZE) != 0);
|
||||||
|
dict_add_number(dict, "posinvert",
|
||||||
|
(wp->w_popup_flags & POPF_POSINVERT) != 0);
|
||||||
|
dict_add_number(dict, "cursorline",
|
||||||
|
(wp->w_popup_flags & POPF_CURSORLINE) != 0);
|
||||||
|
dict_add_string(dict, "highlight", wp->w_p_wcr);
|
||||||
|
if (wp->w_scrollbar_highlight != NULL)
|
||||||
|
dict_add_string(dict, "scrollbarhighlight",
|
||||||
|
wp->w_scrollbar_highlight);
|
||||||
|
if (wp->w_thumb_highlight != NULL)
|
||||||
|
dict_add_string(dict, "thumbhighlight", wp->w_thumb_highlight);
|
||||||
|
|
||||||
dict = rettv->vval.v_dict;
|
// find the tabpage that holds this popup
|
||||||
dict_add_number(dict, "line", wp->w_wantline);
|
i = 1;
|
||||||
dict_add_number(dict, "col", wp->w_wantcol);
|
FOR_ALL_TABPAGES(tp)
|
||||||
dict_add_number(dict, "minwidth", wp->w_minwidth);
|
{
|
||||||
dict_add_number(dict, "minheight", wp->w_minheight);
|
win_T *twp;
|
||||||
dict_add_number(dict, "maxheight", wp->w_maxheight);
|
|
||||||
dict_add_number(dict, "maxwidth", wp->w_maxwidth);
|
|
||||||
dict_add_number(dict, "firstline", wp->w_firstline);
|
|
||||||
dict_add_number(dict, "scrollbar", wp->w_want_scrollbar);
|
|
||||||
dict_add_number(dict, "zindex", wp->w_zindex);
|
|
||||||
dict_add_number(dict, "fixed", wp->w_popup_fixed);
|
|
||||||
if (wp->w_popup_prop_type && win_valid_any_tab(wp->w_popup_prop_win))
|
|
||||||
{
|
|
||||||
proptype_T *pt = text_prop_type_by_id(
|
|
||||||
wp->w_popup_prop_win->w_buffer,
|
|
||||||
wp->w_popup_prop_type);
|
|
||||||
|
|
||||||
if (pt != NULL)
|
FOR_ALL_POPUPWINS_IN_TAB(tp, twp)
|
||||||
dict_add_string(dict, "textprop", pt->pt_name);
|
if (twp->w_id == id)
|
||||||
dict_add_number(dict, "textpropwin", wp->w_popup_prop_win->w_id);
|
|
||||||
dict_add_number(dict, "textpropid", wp->w_popup_prop_id);
|
|
||||||
}
|
|
||||||
dict_add_string(dict, "title", wp->w_popup_title);
|
|
||||||
dict_add_number(dict, "wrap", wp->w_p_wrap);
|
|
||||||
dict_add_number(dict, "drag", (wp->w_popup_flags & POPF_DRAG) != 0);
|
|
||||||
dict_add_number(dict, "dragall",
|
|
||||||
(wp->w_popup_flags & POPF_DRAGALL) != 0);
|
|
||||||
dict_add_number(dict, "mapping",
|
|
||||||
(wp->w_popup_flags & POPF_MAPPING) != 0);
|
|
||||||
dict_add_number(dict, "resize", (wp->w_popup_flags & POPF_RESIZE) != 0);
|
|
||||||
dict_add_number(dict, "posinvert",
|
|
||||||
(wp->w_popup_flags & POPF_POSINVERT) != 0);
|
|
||||||
dict_add_number(dict, "cursorline",
|
|
||||||
(wp->w_popup_flags & POPF_CURSORLINE) != 0);
|
|
||||||
dict_add_string(dict, "highlight", wp->w_p_wcr);
|
|
||||||
if (wp->w_scrollbar_highlight != NULL)
|
|
||||||
dict_add_string(dict, "scrollbarhighlight",
|
|
||||||
wp->w_scrollbar_highlight);
|
|
||||||
if (wp->w_thumb_highlight != NULL)
|
|
||||||
dict_add_string(dict, "thumbhighlight", wp->w_thumb_highlight);
|
|
||||||
|
|
||||||
// find the tabpage that holds this popup
|
|
||||||
i = 1;
|
|
||||||
FOR_ALL_TABPAGES(tp)
|
|
||||||
{
|
|
||||||
win_T *twp;
|
|
||||||
|
|
||||||
FOR_ALL_POPUPWINS_IN_TAB(tp, twp)
|
|
||||||
if (twp->w_id == id)
|
|
||||||
break;
|
|
||||||
if (twp != NULL)
|
|
||||||
break;
|
break;
|
||||||
++i;
|
if (twp != NULL)
|
||||||
|
break;
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
if (tp == NULL)
|
||||||
|
i = -1; // must be global
|
||||||
|
else if (tp == curtab)
|
||||||
|
i = 0;
|
||||||
|
dict_add_number(dict, "tabpage", i);
|
||||||
|
|
||||||
|
get_padding_border(dict, wp->w_popup_padding, "padding");
|
||||||
|
get_padding_border(dict, wp->w_popup_border, "border");
|
||||||
|
get_borderhighlight(dict, wp);
|
||||||
|
get_borderchars(dict, wp);
|
||||||
|
get_moved_list(dict, wp);
|
||||||
|
|
||||||
|
if (wp->w_filter_cb.cb_name != NULL)
|
||||||
|
dict_add_callback(dict, "filter", &wp->w_filter_cb);
|
||||||
|
if (wp->w_close_cb.cb_name != NULL)
|
||||||
|
dict_add_callback(dict, "callback", &wp->w_close_cb);
|
||||||
|
|
||||||
|
for (i = 0; i < (int)ARRAY_LENGTH(poppos_entries); ++i)
|
||||||
|
if (wp->w_popup_pos == poppos_entries[i].pp_val)
|
||||||
|
{
|
||||||
|
dict_add_string(dict, "pos",
|
||||||
|
(char_u *)poppos_entries[i].pp_name);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (tp == NULL)
|
|
||||||
i = -1; // must be global
|
|
||||||
else if (tp == curtab)
|
|
||||||
i = 0;
|
|
||||||
dict_add_number(dict, "tabpage", i);
|
|
||||||
|
|
||||||
get_padding_border(dict, wp->w_popup_padding, "padding");
|
dict_add_string(dict, "close", (char_u *)(
|
||||||
get_padding_border(dict, wp->w_popup_border, "border");
|
wp->w_popup_close == POPCLOSE_BUTTON ? "button"
|
||||||
get_borderhighlight(dict, wp);
|
: wp->w_popup_close == POPCLOSE_CLICK ? "click" : "none"));
|
||||||
get_borderchars(dict, wp);
|
|
||||||
get_moved_list(dict, wp);
|
|
||||||
|
|
||||||
if (wp->w_filter_cb.cb_name != NULL)
|
|
||||||
dict_add_callback(dict, "filter", &wp->w_filter_cb);
|
|
||||||
if (wp->w_close_cb.cb_name != NULL)
|
|
||||||
dict_add_callback(dict, "callback", &wp->w_close_cb);
|
|
||||||
|
|
||||||
for (i = 0; i < (int)ARRAY_LENGTH(poppos_entries); ++i)
|
|
||||||
if (wp->w_popup_pos == poppos_entries[i].pp_val)
|
|
||||||
{
|
|
||||||
dict_add_string(dict, "pos",
|
|
||||||
(char_u *)poppos_entries[i].pp_name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
dict_add_string(dict, "close", (char_u *)(
|
|
||||||
wp->w_popup_close == POPCLOSE_BUTTON ? "button"
|
|
||||||
: wp->w_popup_close == POPCLOSE_CLICK ? "click" : "none"));
|
|
||||||
|
|
||||||
# if defined(FEAT_TIMERS)
|
# if defined(FEAT_TIMERS)
|
||||||
dict_add_number(dict, "time", wp->w_popup_timer != NULL
|
dict_add_number(dict, "time", wp->w_popup_timer != NULL
|
||||||
? (long)wp->w_popup_timer->tr_interval : 0L);
|
? (long)wp->w_popup_timer->tr_interval : 0L);
|
||||||
# endif
|
# endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(FEAT_TERMINAL) || defined(PROTO)
|
# if defined(FEAT_TERMINAL) || defined(PROTO)
|
||||||
@ -3640,49 +3641,49 @@ popup_masked(win_T *wp, int width, int height, int screencol, int screenline)
|
|||||||
static void
|
static void
|
||||||
update_popup_transparent(win_T *wp, int val)
|
update_popup_transparent(win_T *wp, int val)
|
||||||
{
|
{
|
||||||
if (wp->w_popup_mask != NULL)
|
if (wp->w_popup_mask == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int width = popup_width(wp);
|
||||||
|
int height = popup_height(wp);
|
||||||
|
listitem_T *lio, *li;
|
||||||
|
int cols, cole;
|
||||||
|
int lines, linee;
|
||||||
|
int col, line;
|
||||||
|
|
||||||
|
FOR_ALL_LIST_ITEMS(wp->w_popup_mask, lio)
|
||||||
{
|
{
|
||||||
int width = popup_width(wp);
|
li = lio->li_tv.vval.v_list->lv_first;
|
||||||
int height = popup_height(wp);
|
cols = tv_get_number(&li->li_tv);
|
||||||
listitem_T *lio, *li;
|
if (cols < 0)
|
||||||
int cols, cole;
|
cols = width + cols + 1;
|
||||||
int lines, linee;
|
li = li->li_next;
|
||||||
int col, line;
|
cole = tv_get_number(&li->li_tv);
|
||||||
|
if (cole < 0)
|
||||||
|
cole = width + cole + 1;
|
||||||
|
li = li->li_next;
|
||||||
|
lines = tv_get_number(&li->li_tv);
|
||||||
|
if (lines < 0)
|
||||||
|
lines = height + lines + 1;
|
||||||
|
li = li->li_next;
|
||||||
|
linee = tv_get_number(&li->li_tv);
|
||||||
|
if (linee < 0)
|
||||||
|
linee = height + linee + 1;
|
||||||
|
|
||||||
FOR_ALL_LIST_ITEMS(wp->w_popup_mask, lio)
|
--cols;
|
||||||
{
|
cols -= wp->w_popup_leftoff;
|
||||||
li = lio->li_tv.vval.v_list->lv_first;
|
if (cols < 0)
|
||||||
cols = tv_get_number(&li->li_tv);
|
cols = 0;
|
||||||
if (cols < 0)
|
cole -= wp->w_popup_leftoff;
|
||||||
cols = width + cols + 1;
|
--lines;
|
||||||
li = li->li_next;
|
if (lines < 0)
|
||||||
cole = tv_get_number(&li->li_tv);
|
lines = 0;
|
||||||
if (cole < 0)
|
for (line = lines; line < linee
|
||||||
cole = width + cole + 1;
|
&& line + wp->w_winrow < screen_Rows; ++line)
|
||||||
li = li->li_next;
|
for (col = cols; col < cole
|
||||||
lines = tv_get_number(&li->li_tv);
|
&& col + wp->w_wincol < screen_Columns; ++col)
|
||||||
if (lines < 0)
|
popup_transparent[(line + wp->w_winrow) * screen_Columns
|
||||||
lines = height + lines + 1;
|
+ col + wp->w_wincol] = val;
|
||||||
li = li->li_next;
|
|
||||||
linee = tv_get_number(&li->li_tv);
|
|
||||||
if (linee < 0)
|
|
||||||
linee = height + linee + 1;
|
|
||||||
|
|
||||||
--cols;
|
|
||||||
cols -= wp->w_popup_leftoff;
|
|
||||||
if (cols < 0)
|
|
||||||
cols = 0;
|
|
||||||
cole -= wp->w_popup_leftoff;
|
|
||||||
--lines;
|
|
||||||
if (lines < 0)
|
|
||||||
lines = 0;
|
|
||||||
for (line = lines; line < linee
|
|
||||||
&& line + wp->w_winrow < screen_Rows; ++line)
|
|
||||||
for (col = cols; col < cole
|
|
||||||
&& col + wp->w_wincol < screen_Columns; ++col)
|
|
||||||
popup_transparent[(line + wp->w_winrow) * screen_Columns
|
|
||||||
+ col + wp->w_wincol] = val;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4508,33 +4509,33 @@ popup_close_info(void)
|
|||||||
win_T *
|
win_T *
|
||||||
popup_get_message_win(void)
|
popup_get_message_win(void)
|
||||||
{
|
{
|
||||||
|
if (message_win != NULL)
|
||||||
|
return message_win;
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
message_win = popup_create(NULL, NULL, TYPE_MESSAGE_WIN);
|
||||||
|
|
||||||
if (message_win == NULL)
|
if (message_win == NULL)
|
||||||
{
|
return NULL;
|
||||||
int i;
|
|
||||||
|
|
||||||
message_win = popup_create(NULL, NULL, TYPE_MESSAGE_WIN);
|
// use the full screen width
|
||||||
|
message_win->w_width = Columns;
|
||||||
|
|
||||||
if (message_win == NULL)
|
// position at bottom of screen
|
||||||
return NULL;
|
message_win->w_popup_pos = POPPOS_BOTTOM;
|
||||||
|
message_win->w_wantcol = 1;
|
||||||
|
message_win->w_minwidth = 9999;
|
||||||
|
message_win->w_firstline = -1;
|
||||||
|
|
||||||
// use the full screen width
|
// no padding, border at the top
|
||||||
message_win->w_width = Columns;
|
for (i = 0; i < 4; ++i)
|
||||||
|
message_win->w_popup_padding[i] = 0;
|
||||||
|
for (i = 1; i < 4; ++i)
|
||||||
|
message_win->w_popup_border[i] = 0;
|
||||||
|
|
||||||
// position at bottom of screen
|
if (message_win->w_popup_timer != NULL)
|
||||||
message_win->w_popup_pos = POPPOS_BOTTOM;
|
message_win->w_popup_timer->tr_keep = TRUE;
|
||||||
message_win->w_wantcol = 1;
|
|
||||||
message_win->w_minwidth = 9999;
|
|
||||||
message_win->w_firstline = -1;
|
|
||||||
|
|
||||||
// no padding, border at the top
|
|
||||||
for (i = 0; i < 4; ++i)
|
|
||||||
message_win->w_popup_padding[i] = 0;
|
|
||||||
for (i = 1; i < 4; ++i)
|
|
||||||
message_win->w_popup_border[i] = 0;
|
|
||||||
|
|
||||||
if (message_win->w_popup_timer != NULL)
|
|
||||||
message_win->w_popup_timer->tr_keep = TRUE;
|
|
||||||
}
|
|
||||||
return message_win;
|
return message_win;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4545,16 +4546,16 @@ popup_get_message_win(void)
|
|||||||
void
|
void
|
||||||
popup_show_message_win(void)
|
popup_show_message_win(void)
|
||||||
{
|
{
|
||||||
if (message_win != NULL)
|
if (message_win == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((message_win->w_popup_flags & POPF_HIDDEN) != 0)
|
||||||
{
|
{
|
||||||
if ((message_win->w_popup_flags & POPF_HIDDEN) != 0)
|
// the highlight may have changed.
|
||||||
{
|
popup_update_color(message_win, TYPE_MESSAGE_WIN);
|
||||||
// the highlight may have changed.
|
popup_show(message_win);
|
||||||
popup_update_color(message_win, TYPE_MESSAGE_WIN);
|
|
||||||
popup_show(message_win);
|
|
||||||
}
|
|
||||||
start_message_win_timer = TRUE;
|
|
||||||
}
|
}
|
||||||
|
start_message_win_timer = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -4664,22 +4665,22 @@ popup_win_closed(win_T *win)
|
|||||||
void
|
void
|
||||||
popup_set_title(win_T *wp)
|
popup_set_title(win_T *wp)
|
||||||
{
|
{
|
||||||
if (wp->w_buffer->b_fname != NULL)
|
if (wp->w_buffer->b_fname == NULL)
|
||||||
{
|
return;
|
||||||
char_u dirname[MAXPATHL];
|
|
||||||
size_t len;
|
|
||||||
|
|
||||||
mch_dirname(dirname, MAXPATHL);
|
char_u dirname[MAXPATHL];
|
||||||
shorten_buf_fname(wp->w_buffer, dirname, FALSE);
|
size_t len;
|
||||||
|
|
||||||
vim_free(wp->w_popup_title);
|
mch_dirname(dirname, MAXPATHL);
|
||||||
len = STRLEN(wp->w_buffer->b_fname) + 3;
|
shorten_buf_fname(wp->w_buffer, dirname, FALSE);
|
||||||
wp->w_popup_title = alloc((int)len);
|
|
||||||
if (wp->w_popup_title != NULL)
|
vim_free(wp->w_popup_title);
|
||||||
vim_snprintf((char *)wp->w_popup_title, len, " %s ",
|
len = STRLEN(wp->w_buffer->b_fname) + 3;
|
||||||
wp->w_buffer->b_fname);
|
wp->w_popup_title = alloc((int)len);
|
||||||
redraw_win_later(wp, UPD_VALID);
|
if (wp->w_popup_title != NULL)
|
||||||
}
|
vim_snprintf((char *)wp->w_popup_title, len, " %s ",
|
||||||
|
wp->w_buffer->b_fname);
|
||||||
|
redraw_win_later(wp, UPD_VALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(FEAT_QUICKFIX) || defined(PROTO)
|
# if defined(FEAT_QUICKFIX) || defined(PROTO)
|
||||||
|
@ -910,16 +910,16 @@ script_prof_restore(proftime_T *tm)
|
|||||||
{
|
{
|
||||||
scriptitem_T *si;
|
scriptitem_T *si;
|
||||||
|
|
||||||
if (SCRIPT_ID_VALID(current_sctx.sc_sid))
|
if (!SCRIPT_ID_VALID(current_sctx.sc_sid))
|
||||||
|
return;
|
||||||
|
|
||||||
|
si = SCRIPT_ITEM(current_sctx.sc_sid);
|
||||||
|
if (si->sn_prof_on && --si->sn_pr_nest == 0)
|
||||||
{
|
{
|
||||||
si = SCRIPT_ITEM(current_sctx.sc_sid);
|
profile_end(&si->sn_pr_child);
|
||||||
if (si->sn_prof_on && --si->sn_pr_nest == 0)
|
profile_sub_wait(tm, &si->sn_pr_child); // don't count wait time
|
||||||
{
|
profile_add(&si->sn_pr_children, &si->sn_pr_child);
|
||||||
profile_end(&si->sn_pr_child);
|
profile_add(&si->sn_prl_children, &si->sn_pr_child);
|
||||||
profile_sub_wait(tm, &si->sn_pr_child); // don't count wait time
|
|
||||||
profile_add(&si->sn_pr_children, &si->sn_pr_child);
|
|
||||||
profile_add(&si->sn_prl_children, &si->sn_pr_child);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1009,17 +1009,17 @@ profile_dump(void)
|
|||||||
{
|
{
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
|
|
||||||
if (profile_fname != NULL)
|
if (profile_fname == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
fd = mch_fopen((char *)profile_fname, "w");
|
||||||
|
if (fd == NULL)
|
||||||
|
semsg(_(e_cant_open_file_str), profile_fname);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
fd = mch_fopen((char *)profile_fname, "w");
|
script_dump_profile(fd);
|
||||||
if (fd == NULL)
|
func_dump_profile(fd);
|
||||||
semsg(_(e_cant_open_file_str), profile_fname);
|
fclose(fd);
|
||||||
else
|
|
||||||
{
|
|
||||||
script_dump_profile(fd);
|
|
||||||
func_dump_profile(fd);
|
|
||||||
fclose(fd);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
286
src/quickfix.c
286
src/quickfix.c
@ -1898,14 +1898,14 @@ qf_store_title(qf_list_T *qfl, char_u *title)
|
|||||||
{
|
{
|
||||||
VIM_CLEAR(qfl->qf_title);
|
VIM_CLEAR(qfl->qf_title);
|
||||||
|
|
||||||
if (title != NULL)
|
if (title == NULL)
|
||||||
{
|
return;
|
||||||
char_u *p = alloc_id(STRLEN(title) + 2, aid_qf_title);
|
|
||||||
|
|
||||||
qfl->qf_title = p;
|
char_u *p = alloc_id(STRLEN(title) + 2, aid_qf_title);
|
||||||
if (p != NULL)
|
|
||||||
STRCPY(p, title);
|
qfl->qf_title = p;
|
||||||
}
|
if (p != NULL)
|
||||||
|
STRCPY(p, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1976,12 +1976,12 @@ locstack_queue_delreq(qf_info_T *qi)
|
|||||||
qf_delq_T *q;
|
qf_delq_T *q;
|
||||||
|
|
||||||
q = ALLOC_ONE(qf_delq_T);
|
q = ALLOC_ONE(qf_delq_T);
|
||||||
if (q != NULL)
|
if (q == NULL)
|
||||||
{
|
return;
|
||||||
q->qi = qi;
|
|
||||||
q->next = qf_delq_head;
|
q->qi = qi;
|
||||||
qf_delq_head = q;
|
q->next = qf_delq_head;
|
||||||
}
|
qf_delq_head = q;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2002,16 +2002,16 @@ wipe_qf_buffer(qf_info_T *qi)
|
|||||||
{
|
{
|
||||||
buf_T *qfbuf;
|
buf_T *qfbuf;
|
||||||
|
|
||||||
if (qi->qf_bufnr != INVALID_QFBUFNR)
|
if (qi->qf_bufnr == INVALID_QFBUFNR)
|
||||||
|
return;
|
||||||
|
|
||||||
|
qfbuf = buflist_findnr(qi->qf_bufnr);
|
||||||
|
if (qfbuf != NULL && qfbuf->b_nwindows == 0)
|
||||||
{
|
{
|
||||||
qfbuf = buflist_findnr(qi->qf_bufnr);
|
// If the quickfix buffer is not loaded in any window, then
|
||||||
if (qfbuf != NULL && qfbuf->b_nwindows == 0)
|
// wipe the buffer.
|
||||||
{
|
close_buffer(NULL, qfbuf, DOBUF_WIPE, FALSE, FALSE);
|
||||||
// If the quickfix buffer is not loaded in any window, then
|
qi->qf_bufnr = INVALID_QFBUFNR;
|
||||||
// wipe the buffer.
|
|
||||||
close_buffer(NULL, qfbuf, DOBUF_WIPE, FALSE, FALSE);
|
|
||||||
qi->qf_bufnr = INVALID_QFBUFNR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2231,12 +2231,12 @@ qf_alloc_stack(qfltype_T qfltype)
|
|||||||
qf_info_T *qi;
|
qf_info_T *qi;
|
||||||
|
|
||||||
qi = ALLOC_CLEAR_ONE_ID(qf_info_T, aid_qf_qfinfo);
|
qi = ALLOC_CLEAR_ONE_ID(qf_info_T, aid_qf_qfinfo);
|
||||||
if (qi != NULL)
|
if (qi == NULL)
|
||||||
{
|
return NULL;
|
||||||
qi->qf_refcount++;
|
|
||||||
qi->qfl_type = qfltype;
|
qi->qf_refcount++;
|
||||||
qi->qf_bufnr = INVALID_QFBUFNR;
|
qi->qfl_type = qfltype;
|
||||||
}
|
qi->qf_bufnr = INVALID_QFBUFNR;
|
||||||
return qi;
|
return qi;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4573,64 +4573,64 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last)
|
|||||||
|
|
||||||
// Check if a buffer for the quickfix list exists. Update it.
|
// Check if a buffer for the quickfix list exists. Update it.
|
||||||
buf = qf_find_buf(qi);
|
buf = qf_find_buf(qi);
|
||||||
if (buf != NULL)
|
if (buf == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
linenr_T old_line_count = buf->b_ml.ml_line_count;
|
||||||
|
int qf_winid = 0;
|
||||||
|
|
||||||
|
if (IS_LL_STACK(qi))
|
||||||
{
|
{
|
||||||
linenr_T old_line_count = buf->b_ml.ml_line_count;
|
if (curwin->w_llist == qi)
|
||||||
int qf_winid = 0;
|
win = curwin;
|
||||||
|
else
|
||||||
if (IS_LL_STACK(qi))
|
|
||||||
{
|
{
|
||||||
if (curwin->w_llist == qi)
|
// Find the file window (non-quickfix) with this location list
|
||||||
win = curwin;
|
win = qf_find_win_with_loclist(qi);
|
||||||
else
|
if (win == NULL)
|
||||||
{
|
// File window is not found. Find the location list window.
|
||||||
// Find the file window (non-quickfix) with this location list
|
win = qf_find_win(qi);
|
||||||
win = qf_find_win_with_loclist(qi);
|
if (win == NULL)
|
||||||
if (win == NULL)
|
return;
|
||||||
// File window is not found. Find the location list window.
|
|
||||||
win = qf_find_win(qi);
|
|
||||||
if (win == NULL)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
qf_winid = win->w_id;
|
|
||||||
}
|
}
|
||||||
|
qf_winid = win->w_id;
|
||||||
|
}
|
||||||
|
|
||||||
// autocommands may cause trouble
|
// autocommands may cause trouble
|
||||||
incr_quickfix_busy();
|
incr_quickfix_busy();
|
||||||
|
|
||||||
|
int do_fill = TRUE;
|
||||||
|
if (old_last == NULL)
|
||||||
|
{
|
||||||
|
// set curwin/curbuf to buf and save a few things
|
||||||
|
aucmd_prepbuf(&aco, buf);
|
||||||
|
if (curbuf != buf)
|
||||||
|
do_fill = FALSE; // failed to find a window for "buf"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (do_fill)
|
||||||
|
{
|
||||||
|
qf_update_win_titlevar(qi);
|
||||||
|
|
||||||
|
qf_fill_buffer(qf_get_curlist(qi), buf, old_last, qf_winid);
|
||||||
|
++CHANGEDTICK(buf);
|
||||||
|
|
||||||
int do_fill = TRUE;
|
|
||||||
if (old_last == NULL)
|
if (old_last == NULL)
|
||||||
{
|
{
|
||||||
// set curwin/curbuf to buf and save a few things
|
(void)qf_win_pos_update(qi, 0);
|
||||||
aucmd_prepbuf(&aco, buf);
|
|
||||||
if (curbuf != buf)
|
// restore curwin/curbuf and a few other things
|
||||||
do_fill = FALSE; // failed to find a window for "buf"
|
aucmd_restbuf(&aco);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_fill)
|
|
||||||
{
|
|
||||||
qf_update_win_titlevar(qi);
|
|
||||||
|
|
||||||
qf_fill_buffer(qf_get_curlist(qi), buf, old_last, qf_winid);
|
|
||||||
++CHANGEDTICK(buf);
|
|
||||||
|
|
||||||
if (old_last == NULL)
|
|
||||||
{
|
|
||||||
(void)qf_win_pos_update(qi, 0);
|
|
||||||
|
|
||||||
// restore curwin/curbuf and a few other things
|
|
||||||
aucmd_restbuf(&aco);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only redraw when added lines are visible. This avoids flickering
|
|
||||||
// when the added lines are not visible.
|
|
||||||
if ((win = qf_find_win(qi)) != NULL && old_line_count < win->w_botline)
|
|
||||||
redraw_buf_later(buf, UPD_NOT_VALID);
|
|
||||||
|
|
||||||
// always called after incr_quickfix_busy()
|
|
||||||
decr_quickfix_busy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only redraw when added lines are visible. This avoids flickering
|
||||||
|
// when the added lines are not visible.
|
||||||
|
if ((win = qf_find_win(qi)) != NULL && old_line_count < win->w_botline)
|
||||||
|
redraw_buf_later(buf, UPD_NOT_VALID);
|
||||||
|
|
||||||
|
// always called after incr_quickfix_busy()
|
||||||
|
decr_quickfix_busy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4924,14 +4924,14 @@ qf_restore_list(qf_info_T *qi, int_u save_qfid)
|
|||||||
{
|
{
|
||||||
int curlist;
|
int curlist;
|
||||||
|
|
||||||
if (qf_get_curlist(qi)->qf_id != save_qfid)
|
if (qf_get_curlist(qi)->qf_id == save_qfid)
|
||||||
{
|
return OK;
|
||||||
curlist = qf_id2nr(qi, save_qfid);
|
|
||||||
if (curlist < 0)
|
curlist = qf_id2nr(qi, save_qfid);
|
||||||
// list is not present
|
if (curlist < 0)
|
||||||
return FAIL;
|
// list is not present
|
||||||
qi->qf_curlist = curlist;
|
return FAIL;
|
||||||
}
|
qi->qf_curlist = curlist;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6544,22 +6544,22 @@ restore_start_dir(char_u *dirname_start)
|
|||||||
{
|
{
|
||||||
char_u *dirname_now = alloc(MAXPATHL);
|
char_u *dirname_now = alloc(MAXPATHL);
|
||||||
|
|
||||||
if (NULL != dirname_now)
|
if (dirname_now == NULL)
|
||||||
{
|
return;
|
||||||
mch_dirname(dirname_now, MAXPATHL);
|
|
||||||
if (STRCMP(dirname_start, dirname_now) != 0)
|
|
||||||
{
|
|
||||||
// If the directory has changed, change it back by building up an
|
|
||||||
// appropriate ex command and executing it.
|
|
||||||
exarg_T ea;
|
|
||||||
|
|
||||||
CLEAR_FIELD(ea);
|
mch_dirname(dirname_now, MAXPATHL);
|
||||||
ea.arg = dirname_start;
|
if (STRCMP(dirname_start, dirname_now) != 0)
|
||||||
ea.cmdidx = (curwin->w_localdir == NULL) ? CMD_cd : CMD_lcd;
|
{
|
||||||
ex_cd(&ea);
|
// If the directory has changed, change it back by building up an
|
||||||
}
|
// appropriate ex command and executing it.
|
||||||
vim_free(dirname_now);
|
exarg_T ea;
|
||||||
|
|
||||||
|
CLEAR_FIELD(ea);
|
||||||
|
ea.arg = dirname_start;
|
||||||
|
ea.cmdidx = (curwin->w_localdir == NULL) ? CMD_cd : CMD_lcd;
|
||||||
|
ex_cd(&ea);
|
||||||
}
|
}
|
||||||
|
vim_free(dirname_now);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -6723,13 +6723,13 @@ wipe_dummy_buffer(buf_T *buf, char_u *dirname_start)
|
|||||||
static void
|
static void
|
||||||
unload_dummy_buffer(buf_T *buf, char_u *dirname_start)
|
unload_dummy_buffer(buf_T *buf, char_u *dirname_start)
|
||||||
{
|
{
|
||||||
if (curbuf != buf) // safety check
|
if (curbuf == buf) // safety check
|
||||||
{
|
return;
|
||||||
close_buffer(NULL, buf, DOBUF_UNLOAD, FALSE, TRUE);
|
|
||||||
|
|
||||||
// When autocommands/'autochdir' option changed directory: go back.
|
close_buffer(NULL, buf, DOBUF_UNLOAD, FALSE, TRUE);
|
||||||
restore_start_dir(dirname_start);
|
|
||||||
}
|
// When autocommands/'autochdir' option changed directory: go back.
|
||||||
|
restore_start_dir(dirname_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||||
@ -6862,37 +6862,37 @@ qf_get_list_from_lines(dict_T *what, dictitem_T *di, dict_T *retdict)
|
|||||||
list_T *l;
|
list_T *l;
|
||||||
|
|
||||||
// Only a List value is supported
|
// Only a List value is supported
|
||||||
if (di->di_tv.v_type == VAR_LIST && di->di_tv.vval.v_list != NULL)
|
if (di->di_tv.v_type != VAR_LIST || di->di_tv.vval.v_list == NULL)
|
||||||
|
return FAIL;
|
||||||
|
|
||||||
|
// If errorformat is supplied then use it, otherwise use the 'efm'
|
||||||
|
// option setting
|
||||||
|
if ((efm_di = dict_find(what, (char_u *)"efm", -1)) != NULL)
|
||||||
{
|
{
|
||||||
// If errorformat is supplied then use it, otherwise use the 'efm'
|
if (efm_di->di_tv.v_type != VAR_STRING ||
|
||||||
// option setting
|
efm_di->di_tv.vval.v_string == NULL)
|
||||||
if ((efm_di = dict_find(what, (char_u *)"efm", -1)) != NULL)
|
|
||||||
{
|
|
||||||
if (efm_di->di_tv.v_type != VAR_STRING ||
|
|
||||||
efm_di->di_tv.vval.v_string == NULL)
|
|
||||||
return FAIL;
|
|
||||||
errorformat = efm_di->di_tv.vval.v_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
l = list_alloc();
|
|
||||||
if (l == NULL)
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
errorformat = efm_di->di_tv.vval.v_string;
|
||||||
qi = qf_alloc_stack(QFLT_INTERNAL);
|
|
||||||
if (qi != NULL)
|
|
||||||
{
|
|
||||||
if (qf_init_ext(qi, 0, NULL, NULL, &di->di_tv, errorformat,
|
|
||||||
TRUE, (linenr_T)0, (linenr_T)0, NULL, NULL) > 0)
|
|
||||||
{
|
|
||||||
(void)get_errorlist(qi, NULL, 0, 0, l);
|
|
||||||
qf_free(&qi->qf_lists[0]);
|
|
||||||
}
|
|
||||||
free(qi);
|
|
||||||
}
|
|
||||||
dict_add_list(retdict, "items", l);
|
|
||||||
status = OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l = list_alloc();
|
||||||
|
if (l == NULL)
|
||||||
|
return FAIL;
|
||||||
|
|
||||||
|
qi = qf_alloc_stack(QFLT_INTERNAL);
|
||||||
|
if (qi != NULL)
|
||||||
|
{
|
||||||
|
if (qf_init_ext(qi, 0, NULL, NULL, &di->di_tv, errorformat,
|
||||||
|
TRUE, (linenr_T)0, (linenr_T)0, NULL, NULL) > 0)
|
||||||
|
{
|
||||||
|
(void)get_errorlist(qi, NULL, 0, 0, l);
|
||||||
|
qf_free(&qi->qf_lists[0]);
|
||||||
|
}
|
||||||
|
free(qi);
|
||||||
|
}
|
||||||
|
dict_add_list(retdict, "items", l);
|
||||||
|
status = OK;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7632,12 +7632,12 @@ qf_setprop_qftf(qf_info_T *qi UNUSED, qf_list_T *qfl, dictitem_T *di)
|
|||||||
|
|
||||||
free_callback(&qfl->qf_qftf_cb);
|
free_callback(&qfl->qf_qftf_cb);
|
||||||
cb = get_callback(&di->di_tv);
|
cb = get_callback(&di->di_tv);
|
||||||
if (cb.cb_name != NULL && *cb.cb_name != NUL)
|
if (cb.cb_name == NULL || *cb.cb_name == NUL)
|
||||||
{
|
return OK;
|
||||||
set_callback(&qfl->qf_qftf_cb, &cb);
|
|
||||||
if (cb.cb_free_name)
|
set_callback(&qfl->qf_qftf_cb, &cb);
|
||||||
vim_free(cb.cb_name);
|
if (cb.cb_free_name)
|
||||||
}
|
vim_free(cb.cb_name);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -8126,11 +8126,11 @@ ex_cexpr(exarg_T *eap)
|
|||||||
// Evaluate the expression. When the result is a string or a list we can
|
// Evaluate the expression. When the result is a string or a list we can
|
||||||
// use it to fill the errorlist.
|
// use it to fill the errorlist.
|
||||||
tv = eval_expr(eap->arg, eap);
|
tv = eval_expr(eap->arg, eap);
|
||||||
if (tv != NULL)
|
if (tv == NULL)
|
||||||
{
|
return;
|
||||||
(void)cexpr_core(eap, tv);
|
|
||||||
free_tv(tv);
|
(void)cexpr_core(eap, tv);
|
||||||
}
|
free_tv(tv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
68
src/regexp.c
68
src/regexp.c
@ -710,10 +710,11 @@ peekchr(void)
|
|||||||
{
|
{
|
||||||
static int after_slash = FALSE;
|
static int after_slash = FALSE;
|
||||||
|
|
||||||
if (curchr == -1)
|
if (curchr != -1)
|
||||||
|
return curchr;
|
||||||
|
|
||||||
|
switch (curchr = regparse[0])
|
||||||
{
|
{
|
||||||
switch (curchr = regparse[0])
|
|
||||||
{
|
|
||||||
case '.':
|
case '.':
|
||||||
case '[':
|
case '[':
|
||||||
case '~':
|
case '~':
|
||||||
@ -743,7 +744,7 @@ peekchr(void)
|
|||||||
case ';': // future ext.
|
case ';': // future ext.
|
||||||
case '`': // future ext.
|
case '`': // future ext.
|
||||||
case '/': // Can't be used in / command
|
case '/': // Can't be used in / command
|
||||||
// magic only after "\v"
|
// magic only after "\v"
|
||||||
if (reg_magic == MAGIC_ALL)
|
if (reg_magic == MAGIC_ALL)
|
||||||
curchr = Magic(curchr);
|
curchr = Magic(curchr);
|
||||||
break;
|
break;
|
||||||
@ -788,8 +789,8 @@ peekchr(void)
|
|||||||
|
|
||||||
// ignore \c \C \m \M \v \V and \Z after '$'
|
// ignore \c \C \m \M \v \V and \Z after '$'
|
||||||
while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C'
|
while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C'
|
||||||
|| p[1] == 'm' || p[1] == 'M'
|
|| p[1] == 'm' || p[1] == 'M'
|
||||||
|| p[1] == 'v' || p[1] == 'V' || p[1] == 'Z'))
|
|| p[1] == 'v' || p[1] == 'V' || p[1] == 'Z'))
|
||||||
{
|
{
|
||||||
if (p[1] == 'v')
|
if (p[1] == 'v')
|
||||||
is_magic_all = TRUE;
|
is_magic_all = TRUE;
|
||||||
@ -802,7 +803,7 @@ peekchr(void)
|
|||||||
&& (p[1] == '|' || p[1] == '&' || p[1] == ')'
|
&& (p[1] == '|' || p[1] == '&' || p[1] == ')'
|
||||||
|| p[1] == 'n'))
|
|| p[1] == 'n'))
|
||||||
|| (is_magic_all
|
|| (is_magic_all
|
||||||
&& (p[0] == '|' || p[0] == '&' || p[0] == ')'))
|
&& (p[0] == '|' || p[0] == '&' || p[0] == ')'))
|
||||||
|| reg_magic == MAGIC_ALL)
|
|| reg_magic == MAGIC_ALL)
|
||||||
curchr = Magic('$');
|
curchr = Magic('$');
|
||||||
}
|
}
|
||||||
@ -858,7 +859,6 @@ peekchr(void)
|
|||||||
default:
|
default:
|
||||||
if (has_mbyte)
|
if (has_mbyte)
|
||||||
curchr = (*mb_ptr2char)(regparse);
|
curchr = (*mb_ptr2char)(regparse);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return curchr;
|
return curchr;
|
||||||
@ -1384,42 +1384,42 @@ prog_magic_wrong(void)
|
|||||||
static void
|
static void
|
||||||
cleanup_subexpr(void)
|
cleanup_subexpr(void)
|
||||||
{
|
{
|
||||||
if (rex.need_clear_subexpr)
|
if (!rex.need_clear_subexpr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (REG_MULTI)
|
||||||
{
|
{
|
||||||
if (REG_MULTI)
|
// Use 0xff to set lnum to -1
|
||||||
{
|
vim_memset(rex.reg_startpos, 0xff, sizeof(lpos_T) * NSUBEXP);
|
||||||
// Use 0xff to set lnum to -1
|
vim_memset(rex.reg_endpos, 0xff, sizeof(lpos_T) * NSUBEXP);
|
||||||
vim_memset(rex.reg_startpos, 0xff, sizeof(lpos_T) * NSUBEXP);
|
|
||||||
vim_memset(rex.reg_endpos, 0xff, sizeof(lpos_T) * NSUBEXP);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vim_memset(rex.reg_startp, 0, sizeof(char_u *) * NSUBEXP);
|
|
||||||
vim_memset(rex.reg_endp, 0, sizeof(char_u *) * NSUBEXP);
|
|
||||||
}
|
|
||||||
rex.need_clear_subexpr = FALSE;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vim_memset(rex.reg_startp, 0, sizeof(char_u *) * NSUBEXP);
|
||||||
|
vim_memset(rex.reg_endp, 0, sizeof(char_u *) * NSUBEXP);
|
||||||
|
}
|
||||||
|
rex.need_clear_subexpr = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_SYN_HL
|
#ifdef FEAT_SYN_HL
|
||||||
static void
|
static void
|
||||||
cleanup_zsubexpr(void)
|
cleanup_zsubexpr(void)
|
||||||
{
|
{
|
||||||
if (rex.need_clear_zsubexpr)
|
if (!rex.need_clear_zsubexpr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (REG_MULTI)
|
||||||
{
|
{
|
||||||
if (REG_MULTI)
|
// Use 0xff to set lnum to -1
|
||||||
{
|
vim_memset(reg_startzpos, 0xff, sizeof(lpos_T) * NSUBEXP);
|
||||||
// Use 0xff to set lnum to -1
|
vim_memset(reg_endzpos, 0xff, sizeof(lpos_T) * NSUBEXP);
|
||||||
vim_memset(reg_startzpos, 0xff, sizeof(lpos_T) * NSUBEXP);
|
|
||||||
vim_memset(reg_endzpos, 0xff, sizeof(lpos_T) * NSUBEXP);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vim_memset(reg_startzp, 0, sizeof(char_u *) * NSUBEXP);
|
|
||||||
vim_memset(reg_endzp, 0, sizeof(char_u *) * NSUBEXP);
|
|
||||||
}
|
|
||||||
rex.need_clear_zsubexpr = FALSE;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vim_memset(reg_startzp, 0, sizeof(char_u *) * NSUBEXP);
|
||||||
|
vim_memset(reg_endzp, 0, sizeof(char_u *) * NSUBEXP);
|
||||||
|
}
|
||||||
|
rex.need_clear_zsubexpr = FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3187,20 +3187,20 @@ save_subexpr(regbehind_T *bp)
|
|||||||
// When "rex.need_clear_subexpr" is set we don't need to save the values,
|
// When "rex.need_clear_subexpr" is set we don't need to save the values,
|
||||||
// only remember that this flag needs to be set again when restoring.
|
// only remember that this flag needs to be set again when restoring.
|
||||||
bp->save_need_clear_subexpr = rex.need_clear_subexpr;
|
bp->save_need_clear_subexpr = rex.need_clear_subexpr;
|
||||||
if (!rex.need_clear_subexpr)
|
if (rex.need_clear_subexpr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0; i < NSUBEXP; ++i)
|
||||||
{
|
{
|
||||||
for (i = 0; i < NSUBEXP; ++i)
|
if (REG_MULTI)
|
||||||
{
|
{
|
||||||
if (REG_MULTI)
|
bp->save_start[i].se_u.pos = rex.reg_startpos[i];
|
||||||
{
|
bp->save_end[i].se_u.pos = rex.reg_endpos[i];
|
||||||
bp->save_start[i].se_u.pos = rex.reg_startpos[i];
|
}
|
||||||
bp->save_end[i].se_u.pos = rex.reg_endpos[i];
|
else
|
||||||
}
|
{
|
||||||
else
|
bp->save_start[i].se_u.ptr = rex.reg_startp[i];
|
||||||
{
|
bp->save_end[i].se_u.ptr = rex.reg_endp[i];
|
||||||
bp->save_start[i].se_u.ptr = rex.reg_startp[i];
|
|
||||||
bp->save_end[i].se_u.ptr = rex.reg_endp[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3215,20 +3215,20 @@ restore_subexpr(regbehind_T *bp)
|
|||||||
|
|
||||||
// Only need to restore saved values when they are not to be cleared.
|
// Only need to restore saved values when they are not to be cleared.
|
||||||
rex.need_clear_subexpr = bp->save_need_clear_subexpr;
|
rex.need_clear_subexpr = bp->save_need_clear_subexpr;
|
||||||
if (!rex.need_clear_subexpr)
|
if (rex.need_clear_subexpr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0; i < NSUBEXP; ++i)
|
||||||
{
|
{
|
||||||
for (i = 0; i < NSUBEXP; ++i)
|
if (REG_MULTI)
|
||||||
{
|
{
|
||||||
if (REG_MULTI)
|
rex.reg_startpos[i] = bp->save_start[i].se_u.pos;
|
||||||
{
|
rex.reg_endpos[i] = bp->save_end[i].se_u.pos;
|
||||||
rex.reg_startpos[i] = bp->save_start[i].se_u.pos;
|
}
|
||||||
rex.reg_endpos[i] = bp->save_end[i].se_u.pos;
|
else
|
||||||
}
|
{
|
||||||
else
|
rex.reg_startp[i] = bp->save_start[i].se_u.ptr;
|
||||||
{
|
rex.reg_endp[i] = bp->save_end[i].se_u.ptr;
|
||||||
rex.reg_startp[i] = bp->save_start[i].se_u.ptr;
|
|
||||||
rex.reg_endp[i] = bp->save_end[i].se_u.ptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
168
src/regexp_nfa.c
168
src/regexp_nfa.c
@ -487,20 +487,20 @@ nfa_get_match_text(nfa_state_T *start)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ret = alloc(len);
|
ret = alloc(len);
|
||||||
if (ret != NULL)
|
if (ret == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
p = start->out->out; // skip first char, it goes into regstart
|
||||||
|
s = ret;
|
||||||
|
while (p->c > 0)
|
||||||
{
|
{
|
||||||
p = start->out->out; // skip first char, it goes into regstart
|
if (has_mbyte)
|
||||||
s = ret;
|
s += (*mb_char2bytes)(p->c, s);
|
||||||
while (p->c > 0)
|
else
|
||||||
{
|
*s++ = p->c;
|
||||||
if (has_mbyte)
|
p = p->out;
|
||||||
s += (*mb_char2bytes)(p->c, s);
|
|
||||||
else
|
|
||||||
*s++ = p->c;
|
|
||||||
p = p->out;
|
|
||||||
}
|
|
||||||
*s = NUL;
|
|
||||||
}
|
}
|
||||||
|
*s = NUL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2782,25 +2782,25 @@ nfa_postfix_dump(char_u *expr, int retval)
|
|||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
f = fopen(NFA_REGEXP_DUMP_LOG, "a");
|
f = fopen(NFA_REGEXP_DUMP_LOG, "a");
|
||||||
if (f != NULL)
|
if (f == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
fprintf(f, "\n-------------------------\n");
|
||||||
|
if (retval == FAIL)
|
||||||
|
fprintf(f, ">>> NFA engine failed... \n");
|
||||||
|
else if (retval == OK)
|
||||||
|
fprintf(f, ">>> NFA engine succeeded !\n");
|
||||||
|
fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
|
||||||
|
for (p = post_start; *p && p < post_ptr; p++)
|
||||||
{
|
{
|
||||||
fprintf(f, "\n-------------------------\n");
|
nfa_set_code(*p);
|
||||||
if (retval == FAIL)
|
fprintf(f, "%s, ", code);
|
||||||
fprintf(f, ">>> NFA engine failed... \n");
|
|
||||||
else if (retval == OK)
|
|
||||||
fprintf(f, ">>> NFA engine succeeded !\n");
|
|
||||||
fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
|
|
||||||
for (p = post_start; *p && p < post_ptr; p++)
|
|
||||||
{
|
|
||||||
nfa_set_code(*p);
|
|
||||||
fprintf(f, "%s, ", code);
|
|
||||||
}
|
|
||||||
fprintf(f, "\"\nPostfix notation (int): ");
|
|
||||||
for (p = post_start; *p && p < post_ptr; p++)
|
|
||||||
fprintf(f, "%d ", *p);
|
|
||||||
fprintf(f, "\n\n");
|
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
|
fprintf(f, "\"\nPostfix notation (int): ");
|
||||||
|
for (p = post_start; *p && p < post_ptr; p++)
|
||||||
|
fprintf(f, "%d ", *p);
|
||||||
|
fprintf(f, "\n\n");
|
||||||
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2883,20 +2883,20 @@ nfa_dump(nfa_regprog_T *prog)
|
|||||||
{
|
{
|
||||||
FILE *debugf = fopen(NFA_REGEXP_DUMP_LOG, "a");
|
FILE *debugf = fopen(NFA_REGEXP_DUMP_LOG, "a");
|
||||||
|
|
||||||
if (debugf != NULL)
|
if (debugf == NULL)
|
||||||
{
|
return;
|
||||||
nfa_print_state(debugf, prog->start);
|
|
||||||
|
|
||||||
if (prog->reganch)
|
nfa_print_state(debugf, prog->start);
|
||||||
fprintf(debugf, "reganch: %d\n", prog->reganch);
|
|
||||||
if (prog->regstart != NUL)
|
|
||||||
fprintf(debugf, "regstart: %c (decimal: %d)\n",
|
|
||||||
prog->regstart, prog->regstart);
|
|
||||||
if (prog->match_text != NULL)
|
|
||||||
fprintf(debugf, "match_text: \"%s\"\n", prog->match_text);
|
|
||||||
|
|
||||||
fclose(debugf);
|
if (prog->reganch)
|
||||||
}
|
fprintf(debugf, "reganch: %d\n", prog->reganch);
|
||||||
|
if (prog->regstart != NUL)
|
||||||
|
fprintf(debugf, "regstart: %c (decimal: %d)\n",
|
||||||
|
prog->regstart, prog->regstart);
|
||||||
|
if (prog->match_text != NULL)
|
||||||
|
fprintf(debugf, "match_text: \"%s\"\n", prog->match_text);
|
||||||
|
|
||||||
|
fclose(debugf);
|
||||||
}
|
}
|
||||||
#endif // ENABLE_LOG
|
#endif // ENABLE_LOG
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
@ -4096,21 +4096,21 @@ clear_sub(regsub_T *sub)
|
|||||||
copy_sub(regsub_T *to, regsub_T *from)
|
copy_sub(regsub_T *to, regsub_T *from)
|
||||||
{
|
{
|
||||||
to->in_use = from->in_use;
|
to->in_use = from->in_use;
|
||||||
if (from->in_use > 0)
|
if (from->in_use <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Copy the match start and end positions.
|
||||||
|
if (REG_MULTI)
|
||||||
{
|
{
|
||||||
// Copy the match start and end positions.
|
mch_memmove(&to->list.multi[0],
|
||||||
if (REG_MULTI)
|
&from->list.multi[0],
|
||||||
{
|
sizeof(struct multipos) * from->in_use);
|
||||||
mch_memmove(&to->list.multi[0],
|
to->orig_start_col = from->orig_start_col;
|
||||||
&from->list.multi[0],
|
|
||||||
sizeof(struct multipos) * from->in_use);
|
|
||||||
to->orig_start_col = from->orig_start_col;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mch_memmove(&to->list.line[0],
|
|
||||||
&from->list.line[0],
|
|
||||||
sizeof(struct linepos) * from->in_use);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
mch_memmove(&to->list.line[0],
|
||||||
|
&from->list.line[0],
|
||||||
|
sizeof(struct linepos) * from->in_use);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4121,18 +4121,18 @@ copy_sub_off(regsub_T *to, regsub_T *from)
|
|||||||
{
|
{
|
||||||
if (to->in_use < from->in_use)
|
if (to->in_use < from->in_use)
|
||||||
to->in_use = from->in_use;
|
to->in_use = from->in_use;
|
||||||
if (from->in_use > 1)
|
if (from->in_use <= 1)
|
||||||
{
|
return;
|
||||||
// Copy the match start and end positions.
|
|
||||||
if (REG_MULTI)
|
// Copy the match start and end positions.
|
||||||
mch_memmove(&to->list.multi[1],
|
if (REG_MULTI)
|
||||||
&from->list.multi[1],
|
mch_memmove(&to->list.multi[1],
|
||||||
sizeof(struct multipos) * (from->in_use - 1));
|
&from->list.multi[1],
|
||||||
else
|
sizeof(struct multipos) * (from->in_use - 1));
|
||||||
mch_memmove(&to->list.line[1],
|
else
|
||||||
&from->list.line[1],
|
mch_memmove(&to->list.line[1],
|
||||||
sizeof(struct linepos) * (from->in_use - 1));
|
&from->list.line[1],
|
||||||
}
|
sizeof(struct linepos) * (from->in_use - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4141,22 +4141,22 @@ copy_sub_off(regsub_T *to, regsub_T *from)
|
|||||||
static void
|
static void
|
||||||
copy_ze_off(regsub_T *to, regsub_T *from)
|
copy_ze_off(regsub_T *to, regsub_T *from)
|
||||||
{
|
{
|
||||||
if (rex.nfa_has_zend)
|
if (!rex.nfa_has_zend)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (REG_MULTI)
|
||||||
{
|
{
|
||||||
if (REG_MULTI)
|
if (from->list.multi[0].end_lnum >= 0)
|
||||||
{
|
{
|
||||||
if (from->list.multi[0].end_lnum >= 0)
|
to->list.multi[0].end_lnum = from->list.multi[0].end_lnum;
|
||||||
{
|
to->list.multi[0].end_col = from->list.multi[0].end_col;
|
||||||
to->list.multi[0].end_lnum = from->list.multi[0].end_lnum;
|
|
||||||
to->list.multi[0].end_col = from->list.multi[0].end_col;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (from->list.line[0].end != NULL)
|
|
||||||
to->list.line[0].end = from->list.line[0].end;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (from->list.line[0].end != NULL)
|
||||||
|
to->list.line[0].end = from->list.line[0].end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -7568,12 +7568,12 @@ fail:
|
|||||||
static void
|
static void
|
||||||
nfa_regfree(regprog_T *prog)
|
nfa_regfree(regprog_T *prog)
|
||||||
{
|
{
|
||||||
if (prog != NULL)
|
if (prog == NULL)
|
||||||
{
|
return;
|
||||||
vim_free(((nfa_regprog_T *)prog)->match_text);
|
|
||||||
vim_free(((nfa_regprog_T *)prog)->pattern);
|
vim_free(((nfa_regprog_T *)prog)->match_text);
|
||||||
vim_free(prog);
|
vim_free(((nfa_regprog_T *)prog)->pattern);
|
||||||
}
|
vim_free(prog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -294,25 +294,25 @@ get_register(
|
|||||||
|
|
||||||
get_yank_register(name, 0);
|
get_yank_register(name, 0);
|
||||||
reg = ALLOC_ONE(yankreg_T);
|
reg = ALLOC_ONE(yankreg_T);
|
||||||
if (reg != NULL)
|
if (reg == NULL)
|
||||||
|
return (void *)NULL;
|
||||||
|
|
||||||
|
*reg = *y_current;
|
||||||
|
if (copy)
|
||||||
{
|
{
|
||||||
*reg = *y_current;
|
// If we run out of memory some or all of the lines are empty.
|
||||||
if (copy)
|
if (reg->y_size == 0)
|
||||||
{
|
reg->y_array = NULL;
|
||||||
// If we run out of memory some or all of the lines are empty.
|
|
||||||
if (reg->y_size == 0)
|
|
||||||
reg->y_array = NULL;
|
|
||||||
else
|
|
||||||
reg->y_array = ALLOC_MULT(char_u *, reg->y_size);
|
|
||||||
if (reg->y_array != NULL)
|
|
||||||
{
|
|
||||||
for (i = 0; i < reg->y_size; ++i)
|
|
||||||
reg->y_array[i] = vim_strsave(y_current->y_array[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
y_current->y_array = NULL;
|
reg->y_array = ALLOC_MULT(char_u *, reg->y_size);
|
||||||
|
if (reg->y_array != NULL)
|
||||||
|
{
|
||||||
|
for (i = 0; i < reg->y_size; ++i)
|
||||||
|
reg->y_array[i] = vim_strsave(y_current->y_array[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
y_current->y_array = NULL;
|
||||||
return (void *)reg;
|
return (void *)reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,22 +716,22 @@ put_reedit_in_typebuf(int silent)
|
|||||||
{
|
{
|
||||||
char_u buf[3];
|
char_u buf[3];
|
||||||
|
|
||||||
if (restart_edit != NUL)
|
if (restart_edit == NUL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (restart_edit == 'V')
|
||||||
{
|
{
|
||||||
if (restart_edit == 'V')
|
buf[0] = 'g';
|
||||||
{
|
buf[1] = 'R';
|
||||||
buf[0] = 'g';
|
buf[2] = NUL;
|
||||||
buf[1] = 'R';
|
|
||||||
buf[2] = NUL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buf[0] = restart_edit == 'I' ? 'i' : restart_edit;
|
|
||||||
buf[1] = NUL;
|
|
||||||
}
|
|
||||||
if (ins_typebuf(buf, REMAP_NONE, 0, TRUE, silent) == OK)
|
|
||||||
restart_edit = NUL;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buf[0] = restart_edit == 'I' ? 'i' : restart_edit;
|
||||||
|
buf[1] = NUL;
|
||||||
|
}
|
||||||
|
if (ins_typebuf(buf, REMAP_NONE, 0, TRUE, silent) == OK)
|
||||||
|
restart_edit = NUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1097,14 +1097,14 @@ clear_registers(void)
|
|||||||
static void
|
static void
|
||||||
free_yank(long n)
|
free_yank(long n)
|
||||||
{
|
{
|
||||||
if (y_current->y_array != NULL)
|
if (y_current->y_array == NULL)
|
||||||
{
|
return;
|
||||||
long i;
|
|
||||||
|
|
||||||
for (i = n; --i >= 0; )
|
long i;
|
||||||
vim_free(y_current->y_array[i]);
|
|
||||||
VIM_CLEAR(y_current->y_array);
|
for (i = n; --i >= 0; )
|
||||||
}
|
vim_free(y_current->y_array[i]);
|
||||||
|
VIM_CLEAR(y_current->y_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -2695,23 +2695,22 @@ get_reg_contents(int regname, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
retval = alloc(len + 1);
|
retval = alloc(len + 1);
|
||||||
|
if (retval == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
// Copy the lines of the yank register into the string.
|
// Copy the lines of the yank register into the string.
|
||||||
if (retval != NULL)
|
len = 0;
|
||||||
|
for (i = 0; i < y_current->y_size; ++i)
|
||||||
{
|
{
|
||||||
len = 0;
|
STRCPY(retval + len, y_current->y_array[i]);
|
||||||
for (i = 0; i < y_current->y_size; ++i)
|
len += (long)STRLEN(retval + len);
|
||||||
{
|
|
||||||
STRCPY(retval + len, y_current->y_array[i]);
|
|
||||||
len += (long)STRLEN(retval + len);
|
|
||||||
|
|
||||||
// Insert a NL between lines and after the last line if y_type is
|
// Insert a NL between lines and after the last line if y_type is
|
||||||
// MLINE.
|
// MLINE.
|
||||||
if (y_current->y_type == MLINE || i < y_current->y_size - 1)
|
if (y_current->y_type == MLINE || i < y_current->y_size - 1)
|
||||||
retval[len++] = '\n';
|
retval[len++] = '\n';
|
||||||
}
|
|
||||||
retval[len] = NUL;
|
|
||||||
}
|
}
|
||||||
|
retval[len] = NUL;
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -695,6 +695,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 */
|
||||||
|
/**/
|
||||||
|
1221,
|
||||||
/**/
|
/**/
|
||||||
1220,
|
1220,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user