tweaks: rewrap a line, reshuffle a declaration, and improve some comments

master
Benno Schulenberg 2019-10-03 17:19:29 +02:00
parent cdb9b04980
commit 3e33d1eba6
2 changed files with 9 additions and 11 deletions

View File

@ -348,9 +348,9 @@ void do_cancel(void)
{ {
} }
/* Add a function to the function list. */ /* Add a function to the linked list of functions. */
void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help, void add_to_funcs(void (*func)(void), int menus, const char *desc,
bool blank_after, bool viewok) const char *help, bool blank_after, bool viewok)
{ {
funcstruct *f = nmalloc(sizeof(funcstruct)); funcstruct *f = nmalloc(sizeof(funcstruct));
@ -371,7 +371,7 @@ void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *h
#endif #endif
} }
/* Add a key combo to the shortcut list. */ /* Add a key combo to the linked list of shortcuts. */
void add_to_sclist(int menus, const char *scstring, const int keycode, void add_to_sclist(int menus, const char *scstring, const int keycode,
void (*func)(void), int toggle) void (*func)(void), int toggle)
{ {
@ -454,14 +454,12 @@ size_t shown_entries_for(int menu)
* the given sequence. */ * the given sequence. */
const keystruct *get_shortcut(int *kbinput) const keystruct *get_shortcut(int *kbinput)
{ {
keystruct *s;
/* Plain characters cannot be shortcuts, so just skip those. */ /* Plain characters cannot be shortcuts, so just skip those. */
if (!meta_key && ((*kbinput >= 0x20 && *kbinput < 0x7F) || if (!meta_key && ((*kbinput >= 0x20 && *kbinput < 0x7F) ||
(*kbinput >= 0xA0 && *kbinput <= 0xFF))) (*kbinput >= 0xA0 && *kbinput <= 0xFF)))
return NULL; return NULL;
for (s = sclist; s != NULL; s = s->next) { for (keystruct *s = sclist; s != NULL; s = s->next) {
if ((s->menus & currmenu) && *kbinput == s->keycode && if ((s->menus & currmenu) && *kbinput == s->keycode &&
meta_key == s->meta) meta_key == s->meta)
return s; return s;

View File

@ -109,7 +109,7 @@ void set_proper_index_and_pww(size_t *leftedge, size_t target, bool forward)
openfile->placewewant = *leftedge + target; openfile->placewewant = *leftedge + target;
} }
/* Move up nearly one screenful. */ /* Move up almost one screenful. */
void do_page_up(void) void do_page_up(void)
{ {
int mustmove = (editwinrows < 3) ? 1 : editwinrows - 2; int mustmove = (editwinrows < 3) ? 1 : editwinrows - 2;
@ -139,7 +139,7 @@ void do_page_up(void)
refresh_needed = TRUE; refresh_needed = TRUE;
} }
/* Move down nearly one screenful. */ /* Move down almost one screenful. */
void do_page_down(void) void do_page_down(void)
{ {
int mustmove = (editwinrows < 3) ? 1 : editwinrows - 2; int mustmove = (editwinrows < 3) ? 1 : editwinrows - 2;
@ -534,7 +534,7 @@ void do_down(void)
} }
#if !defined(NANO_TINY) || defined(ENABLE_HELP) #if !defined(NANO_TINY) || defined(ENABLE_HELP)
/* Scroll up one line or chunk without scrolling the cursor. */ /* Scroll up one line or chunk without moving the cursor textwise. */
void do_scroll_up(void) void do_scroll_up(void)
{ {
/* When the top of the file is onscreen, we can't scroll. */ /* When the top of the file is onscreen, we can't scroll. */
@ -548,7 +548,7 @@ void do_scroll_up(void)
edit_scroll(BACKWARD); edit_scroll(BACKWARD);
} }
/* Scroll down one line or chunk without scrolling the cursor. */ /* Scroll down one line or chunk without moving the cursor textwise. */
void do_scroll_down(void) void do_scroll_down(void)
{ {
if (openfile->current_y == 0) if (openfile->current_y == 0)