mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
feat: implement a working WinScrolled autocmd
This commit is contained in:
@@ -4965,6 +4965,30 @@ void shell_new_columns(void)
|
||||
win_reconfig_floats(); // The size of floats might change
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if "wp" has scrolled since last time it was checked
|
||||
*/
|
||||
bool win_did_scroll(win_T *wp)
|
||||
{
|
||||
return (curwin->w_last_topline != curwin->w_topline ||
|
||||
curwin->w_last_leftcol != curwin->w_leftcol ||
|
||||
curwin->w_last_width != curwin->w_width ||
|
||||
curwin->w_last_height != curwin->w_height);
|
||||
}
|
||||
|
||||
/*
|
||||
* Trigger WinScrolled autocmd
|
||||
*/
|
||||
void do_autocmd_winscrolled(win_T *wp)
|
||||
{
|
||||
apply_autocmds(EVENT_WINSCROLLED, NULL, NULL, false, curbuf);
|
||||
|
||||
wp->w_last_topline = wp->w_topline;
|
||||
wp->w_last_leftcol = wp->w_leftcol;
|
||||
wp->w_last_width = wp->w_width;
|
||||
wp->w_last_height = wp->w_height;
|
||||
}
|
||||
|
||||
/*
|
||||
* Save the size of all windows in "gap".
|
||||
*/
|
||||
|
Reference in New Issue
Block a user