if (key_buffer != NULL)
return;
- /* Read in the first character using blocking input. */
#ifndef NANO_TINY
allow_pending_sigwinch(TRUE);
#endif
* screen updates. */
doupdate();
+ /* Read in the first character using whatever mode we're in. */
errcount = 0;
if (nodelay_mode) {
if ((input = wgetch(win)) == ERR)
#endif
}
- /* Switch back to non-blocking input. */
+ /* Switch back to waiting mode for input. */
nodelay(win, FALSE);
#ifdef DEBUG
* [arrow key], Ctrl-[arrow key], Shift-[arrow key], Enter, Backspace,
* the editing keypad (Insert, Delete, Home, End, PageUp, and PageDown),
* the function keypad (F1-F16), and the numeric keypad with NumLock
- * off. Assume nodelay(win) is FALSE. */
+ * off. */
int get_kbinput(WINDOW *win, bool *meta_key, bool *func_key)
{
int kbinput;
/* Translate ASCII characters, extended keypad values, and escape
* sequences into their corresponding key values. Set meta_key to TRUE
* when we get a meta key sequence, and set func_key to TRUE when we get
- * a function key. Assume nodelay(win) is FALSE. */
+ * a function key. */
int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key)
{
static int escapes = 0, byte_digits = 0;
break;
case 3:
/* Third digit: This must be from zero to five if the first
- * was two and the second was between zero and five, and may
- * be any decimal value if the first was zero or one and the
- * second was between six and nine. Put it in the 1's
- * position of the byte sequence holder. */
+ * was two and the second was five, and may be any decimal
+ * value otherwise. Put it in the 1's position of the byte
+ * sequence holder. */
if (('0' <= kbinput && kbinput <= '5') || (byte < 250 &&
'6' <= kbinput && kbinput <= '9')) {
byte += kbinput - '0';
- /* If this character is a valid decimal value, then the
- * byte sequence is complete. */
+ /* The byte sequence is complete. */
retval = byte;
} else
/* This isn't the third digit of a byte sequence.
int update_line(filestruct *fileptr, size_t index)
{
int line = 0;
- int extralinesused = 0;
/* The line in the edit window that we want to update. */
+ int extralinesused = 0;
char *converted;
/* fileptr->data converted to have tabs and control characters
* expanded. */
break;
openfile->edittop = openfile->edittop->next;
}
- /* Don't over-scroll on long lines */
+ /* Don't over-scroll on long lines. */
if (ISSET(SOFTWRAP) && (direction == UP_DIR)) {
ssize_t len = strlenpt(openfile->edittop->data) / COLS;
i -= len;
filestruct *foo;
int nlines;
- /* Figure out what maxrows should really be */
+ /* Figure out what maxrows should really be. */
compute_maxrows();
if (openfile->current->lineno < openfile->edittop->lineno ||