- If there are more than MAIN_VISIBLE shortcuts available, only
register clicks on the first MAIN_VISIBLE shortcuts, since
bottombars() only shows that many shortcuts. (DLR)
+ edit_update()
+ - Simplify so as not to require the fileptr parameter anymore,
+ since it's set to current in all calls. (DLR)
do_yesno()
- Don't bother assigning the value of get_mouseinput() to
anything. Since allow_shortcuts is FALSE, its return value
placewewant = 0;
current_x = 0;
if (edittop != fileage || need_vertical_update(old_pww))
- edit_update(current, TOP);
+ edit_update(TOP);
}
void do_last_line(void)
current_x = 0;
if (edittop->lineno + (editwinrows / 2) != filebot->lineno ||
need_vertical_update(old_pww))
- edit_update(current, CENTER);
+ edit_update(CENTER);
}
void do_home(void)
void edit_scroll(updown direction, int nlines);
void edit_redraw(const filestruct *old_current, size_t old_pww);
void edit_refresh(void);
-void edit_update(filestruct *fileptr, topmidnone location);
+void edit_update(topmidnone location);
int statusq(int allowtabs, const shortcut *s, const char *def,
#ifndef NANO_SMALL
historyheadtype *history_list,
/* If save_pos is TRUE, don't change the cursor position when
* updating the edit window. */
- edit_update(current, save_pos ? NONE : CENTER);
+ edit_update(save_pos ? NONE : CENTER);
placewewant = 0;
display_main_list();
* current->lineno = edittop->lineno + editwinrows / 2. Thus
* when it then calls edit_refresh(), there is no danger of
* getting an infinite loop. */
- edit_update(current, CENTER);
+ edit_update(CENTER);
else {
int nlines = 0;
const filestruct *foo = edittop;
}
}
-/* Nice generic routine to update the edit buffer, given a pointer to the
- * file struct =) */
-void edit_update(filestruct *fileptr, topmidnone location)
+/* A nice generic routine to update the edit buffer. */
+void edit_update(topmidnone location)
{
- if (fileptr == NULL)
+ filestruct *foo = current;
+
+ /* We shouldn't need this check. Yuck. */
+ if (current == NULL)
return;
if (location != TOP) {
int goal = (location == NONE) ? current_y : editwinrows / 2;
- for (; goal > 0 && fileptr->prev != NULL; goal--)
- fileptr = fileptr->prev;
+ for (; goal > 0 && foo->prev != NULL; goal--)
+ foo = foo->prev;
}
- edittop = fileptr;
+ edittop = foo;
edit_refresh();
}