mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
scroll: cleanup unnecessary code & comments
This commit is contained in:
@@ -1486,22 +1486,7 @@ static void ins_redraw(
|
|||||||
&& (curwin->w_last_topline != curwin->w_topline ||
|
&& (curwin->w_last_topline != curwin->w_topline ||
|
||||||
curwin->w_last_leftcol != curwin->w_leftcol)) {
|
curwin->w_last_leftcol != curwin->w_leftcol)) {
|
||||||
|
|
||||||
// XXX is the buf changedtick thing necessary?
|
|
||||||
// XXX apply_autocmds vs ins_apply_autocmds?
|
|
||||||
// XXX why can't we re-use normal_check_window_scrolled()?
|
|
||||||
|
|
||||||
aco_save_T aco;
|
|
||||||
varnumber_T tick = buf_get_changedtick(curbuf);
|
|
||||||
|
|
||||||
// save and restore curwin and curbuf, in case the autocmd changes them
|
|
||||||
aucmd_prepbuf(&aco, curbuf);
|
|
||||||
apply_autocmds(EVENT_SCROLL, NULL, NULL, false, curbuf);
|
apply_autocmds(EVENT_SCROLL, NULL, NULL, false, curbuf);
|
||||||
aucmd_restbuf(&aco);
|
|
||||||
curbuf->b_last_changedtick_pum = buf_get_changedtick(curbuf);
|
|
||||||
if (tick != buf_get_changedtick(curbuf)) { // see ins_apply_autocmds()
|
|
||||||
u_save(curwin->w_cursor.lnum,
|
|
||||||
(linenr_T)(curwin->w_cursor.lnum + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
curwin->w_last_topline = curwin->w_topline;
|
curwin->w_last_topline = curwin->w_topline;
|
||||||
curwin->w_last_leftcol = curwin->w_leftcol;
|
curwin->w_last_leftcol = curwin->w_leftcol;
|
||||||
|
@@ -1195,8 +1195,6 @@ static void normal_check_interrupt(NormalState *s)
|
|||||||
|
|
||||||
static void normal_check_window_scrolled(NormalState *s)
|
static void normal_check_window_scrolled(NormalState *s)
|
||||||
{
|
{
|
||||||
// XXX why is has_event necessary?
|
|
||||||
|
|
||||||
// Trigger Scroll if the window moved.
|
// Trigger Scroll if the window moved.
|
||||||
if (!finish_op && has_event(EVENT_SCROLL)
|
if (!finish_op && has_event(EVENT_SCROLL)
|
||||||
&& (curwin->w_last_topline != curwin->w_topline ||
|
&& (curwin->w_last_topline != curwin->w_topline ||
|
||||||
|
Reference in New Issue
Block a user