mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.4052: not easy to resize a window from a plugin
Problem: Not easy to resize a window from a plugin. Solution: Add win_move_separator() and win_move_statusline() functions. (Daniel Steinberg, closes #9486)
This commit is contained in:
committed by
Bram Moolenaar
parent
b06cfcf5a3
commit
ee63031b57
@@ -835,6 +835,56 @@ f_win_id2win(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_number = win_id2win(argvars);
|
||||
}
|
||||
|
||||
/*
|
||||
* "win_move_separator()" function
|
||||
*/
|
||||
void
|
||||
f_win_move_separator(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
win_T *wp;
|
||||
int offset;
|
||||
|
||||
rettv->vval.v_number = FALSE;
|
||||
|
||||
if (in_vim9script()
|
||||
&& (check_for_number_arg(argvars, 0) == FAIL
|
||||
|| check_for_number_arg(argvars, 1) == FAIL))
|
||||
return;
|
||||
|
||||
wp = find_win_by_nr_or_id(&argvars[0]);
|
||||
if (wp == NULL || win_valid_popup(wp))
|
||||
return;
|
||||
|
||||
offset = (int)tv_get_number(&argvars[1]);
|
||||
win_drag_vsep_line(wp, offset);
|
||||
rettv->vval.v_number = TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* "win_move_statusline()" function
|
||||
*/
|
||||
void
|
||||
f_win_move_statusline(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
win_T *wp;
|
||||
int offset;
|
||||
|
||||
rettv->vval.v_number = FALSE;
|
||||
|
||||
if (in_vim9script()
|
||||
&& (check_for_number_arg(argvars, 0) == FAIL
|
||||
|| check_for_number_arg(argvars, 1) == FAIL))
|
||||
return;
|
||||
|
||||
wp = find_win_by_nr_or_id(&argvars[0]);
|
||||
if (wp == NULL || win_valid_popup(wp))
|
||||
return;
|
||||
|
||||
offset = (int)tv_get_number(&argvars[1]);
|
||||
win_drag_status_line(wp, offset);
|
||||
rettv->vval.v_number = TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* "win_screenpos()" function
|
||||
*/
|
||||
|
Reference in New Issue
Block a user