nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit a24e72f972abfbfe650f0821310d24299cfef341
parent a29aa31e93fc3acab74db2fee6d7469082e40a35
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  4 Feb 2022 11:51:23 +0100

tweaks: rename a variable, to make it clearer it refers to a window

Diffstat:
Msrc/browser.c | 20++++++++++----------
Msrc/files.c | 8++++----
Msrc/global.c | 2+-
Msrc/help.c | 2+-
Msrc/nano.c | 24++++++++++++------------
Msrc/prototypes.h | 2+-
Msrc/search.c | 18+++++++++---------
Msrc/text.c | 4++--
Msrc/winio.c | 154++++++++++++++++++++++++++++++++++++++++----------------------------------------
9 files changed, 117 insertions(+), 117 deletions(-)

diff --git a/src/browser.c b/src/browser.c @@ -170,16 +170,16 @@ void browser_refresh(void) /* If this is the selected item, draw its highlighted bar upfront, and * remember its location to be able to place the cursor on it. */ if (index == selected) { - wattron(edit, interface_color_pair[SELECTED_TEXT]); - mvwprintw(edit, row, col, "%*s", longest, " "); + wattron(midwin, interface_color_pair[SELECTED_TEXT]); + mvwprintw(midwin, row, col, "%*s", longest, " "); the_row = row; the_column = col; } /* If the name is too long, we display something like "...ename". */ if (dots) - mvwaddstr(edit, row, col, "..."); - mvwaddstr(edit, row, dots ? col + 3 : col, disp); + mvwaddstr(midwin, row, col, "..."); + mvwaddstr(midwin, row, dots ? col + 3 : col, disp); col += longest; @@ -235,11 +235,11 @@ void browser_refresh(void) infolen = infomaxlen; } - mvwaddstr(edit, row, col - infolen, info); + mvwaddstr(midwin, row, col - infolen, info); /* If this is the selected item, finish its highlighting. */ if (index == selected) - wattroff(edit, interface_color_pair[SELECTED_TEXT]); + wattroff(midwin, interface_color_pair[SELECTED_TEXT]); free(disp); free(info); @@ -256,11 +256,11 @@ void browser_refresh(void) /* If requested, put the cursor on the selected item and switch it on. */ if (ISSET(SHOW_CURSOR)) { - wmove(edit, the_row, the_column); + wmove(midwin, the_row, the_column); curs_set(1); } - wnoutrefresh(edit); + wnoutrefresh(midwin); } /* Look for the given needle in the list of files. If forwards is TRUE, @@ -484,7 +484,7 @@ char *browse(char *path) old_selected = selected; - kbinput = get_kbinput(edit, ISSET(SHOW_CURSOR)); + kbinput = get_kbinput(midwin, ISSET(SHOW_CURSOR)); #ifdef ENABLE_MOUSE if (kbinput == KEY_MOUSE) { @@ -492,7 +492,7 @@ char *browse(char *path) /* When the user clicked in the file list, select a filename. */ if (get_mouseinput(&mouse_y, &mouse_x, TRUE) == 0 && - wmouse_trafo(edit, &mouse_y, &mouse_x, FALSE)) { + wmouse_trafo(midwin, &mouse_y, &mouse_x, FALSE)) { selected = selected - selected % (usable_rows * piles) + (mouse_y * piles) + (mouse_x / (longest + 2)); diff --git a/src/files.c b/src/files.c @@ -2666,23 +2666,23 @@ char *input_tab(char *morsel, size_t *place, void (*refresh_func)(void), bool *l for (match = 0; match < num_matches; match++) { char *disp; - wmove(edit, row, (longest_name + 2) * (match % ncols)); + wmove(midwin, row, (longest_name + 2) * (match % ncols)); if (row == lastrow && (match + 1) % ncols == 0 && match + 1 < num_matches) { - waddstr(edit, _("(more)")); + waddstr(midwin, _("(more)")); break; } disp = display_string(matches[match], 0, longest_name, FALSE, FALSE); - waddstr(edit, disp); + waddstr(midwin, disp); free(disp); if ((match + 1) % ncols == 0) row++; } - wnoutrefresh(edit); + wnoutrefresh(midwin); *listed = TRUE; } diff --git a/src/global.c b/src/global.c @@ -118,7 +118,7 @@ size_t wrap_at = 0; WINDOW *topwin = NULL; /* The top portion of the screen, showing the version number of nano, * the name of the file, and whether the buffer was modified. */ -WINDOW *edit = NULL; +WINDOW *midwin = NULL; /* The middle portion of the screen: the edit window, showing the * contents of the current buffer, the file we are editing. */ WINDOW *bottomwin = NULL; diff --git a/src/help.c b/src/help.c @@ -463,7 +463,7 @@ void show_help(void) focusing = TRUE; /* Show the cursor when we searched and found something. */ - kbinput = get_kbinput(edit, didfind == 1 || ISSET(SHOW_CURSOR)); + kbinput = get_kbinput(midwin, didfind == 1 || ISSET(SHOW_CURSOR)); didfind = 0; diff --git a/src/nano.c b/src/nano.c @@ -249,7 +249,7 @@ void finish(void) /* Deallocate the two or three subwindows. */ if (topwin != NULL) delwin(topwin); - delwin(edit); + delwin(midwin); delwin(bottomwin); #endif /* Switch the cursor on, exit from curses, and restore terminal settings. */ @@ -403,10 +403,10 @@ void die(const char *msg, ...) void window_init(void) { /* When resizing, first delete the existing windows. */ - if (edit != NULL) { + if (midwin != NULL) { if (topwin != NULL) delwin(topwin); - delwin(edit); + delwin(midwin); delwin(bottomwin); } @@ -417,7 +417,7 @@ void window_init(void) editwinrows = (ISSET(ZERO) ? LINES : 1); /* Set up two subwindows. If the terminal is just one line, * edit window and status-bar window will cover each other. */ - edit = newwin(editwinrows, COLS, 0, 0); + midwin = newwin(editwinrows, COLS, 0, 0); bottomwin = newwin(1, COLS, LINES - 1, 0); } else { int toprows = ((ISSET(EMPTY_LINE) && LINES > 6) ? 2 : 1); @@ -432,7 +432,7 @@ void window_init(void) /* Set up the normal three subwindows. */ if (toprows > 0) topwin = newwin(toprows, COLS, 0, 0); - edit = newwin(editwinrows, COLS, toprows, 0); + midwin = newwin(editwinrows, COLS, toprows, 0); bottomwin = newwin(bottomrows, COLS, LINES - bottomrows, 0); } @@ -441,7 +441,7 @@ void window_init(void) /* When not disabled, turn escape-sequence translation on. */ if (!ISSET(RAW_SEQUENCES)) { - keypad(edit, TRUE); + keypad(midwin, TRUE); keypad(bottomwin, TRUE); } @@ -1306,7 +1306,7 @@ int do_mouse(void) return retval; /* If the click was in the edit window, put the cursor in that spot. */ - if (wmouse_trafo(edit, &click_row, &click_col, FALSE)) { + if (wmouse_trafo(midwin, &click_row, &click_col, FALSE)) { linestruct *current_save = openfile->current; ssize_t row_count = click_row - openfile->current_y; size_t leftedge; @@ -1389,7 +1389,7 @@ void suck_up_input_and_paste_it(void) cutbuffer = line; while (bracketed_paste) { - int input = get_kbinput(edit, BLIND); + int input = get_kbinput(midwin, BLIND); if (input == '\r' || input == '\n') { line->next = make_new_node(line); @@ -1521,7 +1521,7 @@ void process_a_keystroke(void) const keystruct *shortcut; /* Read in a keystroke, and show the cursor while waiting. */ - input = get_kbinput(edit, VISIBLE); + input = get_kbinput(midwin, VISIBLE); lastmessage = VACUUM; @@ -1534,7 +1534,7 @@ void process_a_keystroke(void) /* If the user clicked on a shortcut, read in the key code that it was * converted into. Else the click has been handled or was invalid. */ if (do_mouse() == 1) - input = get_kbinput(edit, BLIND); + input = get_kbinput(midwin, BLIND); else return; } @@ -2556,13 +2556,13 @@ int main(int argc, char **argv) if (ISSET(ZERO) && lastmessage > HUSH) { if (openfile->current_y == editwinrows - 1 && LINES > 1) { edit_scroll(FORWARD); - wnoutrefresh(edit); + wnoutrefresh(midwin); } wredrawln(bottomwin, 0 ,1); wnoutrefresh(bottomwin); place_the_cursor(); } else if (ISSET(ZERO) && lastmessage > VACUUM) - wredrawln(edit, editwinrows - 1, 1); + wredrawln(midwin, editwinrows - 1, 1); #endif errno = 0; diff --git a/src/prototypes.h b/src/prototypes.h @@ -87,7 +87,7 @@ extern size_t wrap_at; #endif extern WINDOW *topwin; -extern WINDOW *edit; +extern WINDOW *midwin; extern WINDOW *bottomwin; extern int editwinrows; extern int editwincols; diff --git a/src/search.c b/src/search.c @@ -186,7 +186,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, /* The time we last looked at the keyboard. */ /* Set non-blocking input so that we can just peek for a Cancel. */ - nodelay(edit, TRUE); + nodelay(midwin, TRUE); if (begin == NULL) came_full_circle = FALSE; @@ -226,14 +226,14 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, #ifndef NANO_TINY if (the_window_resized) { regenerate_screen(); - nodelay(edit, TRUE); + nodelay(midwin, TRUE); statusbar(_("Searching...")); feedback = 1; } #endif /* If we're back at the beginning, then there is no needle. */ if (came_full_circle) { - nodelay(edit, FALSE); + nodelay(midwin, FALSE); return 0; } @@ -244,7 +244,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, * but stop when spell-checking or replacing in a region. */ if (line == NULL) { if (whole_word_only || modus == INREGION) { - nodelay(edit, FALSE); + nodelay(midwin, FALSE); return 0; } @@ -268,7 +268,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, /* Glance at the keyboard once every second, to check for a Cancel. */ if (time(NULL) - lastkbcheck > 0) { - int input = wgetch(edit); + int input = wgetch(midwin); lastkbcheck = time(NULL); @@ -276,7 +276,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, while (input != ERR) { if (input == ESC_CODE) { napms(20); - input = wgetch(edit); + input = wgetch(midwin); meta_key = TRUE; } else meta_key = FALSE; @@ -290,11 +290,11 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, /* Clear out the key buffer (in case a macro is running). */ while (input != ERR) input = get_input(NULL); - nodelay(edit, FALSE); + nodelay(midwin, FALSE); return -2; } - input = wgetch(edit); + input = wgetch(midwin); } if (++feedback > 0) @@ -306,7 +306,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, found_x = found - line->data; - nodelay(edit, FALSE); + nodelay(midwin, FALSE); /* Ensure that the found occurrence is not beyond the starting x. */ if (came_full_circle && ((!ISSET(BACKWARDS_SEARCH) && (found_x > begin_x || diff --git a/src/text.c b/src/text.c @@ -2818,7 +2818,7 @@ void do_linter(void) /* Place the cursor to indicate the affected line. */ place_the_cursor(); - wnoutrefresh(edit); + wnoutrefresh(midwin); kbinput = get_kbinput(bottomwin, VISIBLE); @@ -2987,7 +2987,7 @@ void do_verbatim_input(void) place_the_cursor(); /* Read in the first one or two bytes of the next keystroke. */ - bytes = get_verbatim_kbinput(edit, &count); + bytes = get_verbatim_kbinput(midwin, &count); /* When something valid was obtained, unsuppress cursor-position display, * insert the bytes into the edit buffer, and blank the status bar. */ diff --git a/src/winio.c b/src/winio.c @@ -219,11 +219,11 @@ void read_keys_from(WINDOW *frame) if (input == ERR) { if (spotlighted || ISSET(ZERO) || LINES == 1) { if (ISSET(ZERO) && lastmessage > VACUUM) - wredrawln(edit, editwinrows - 1 , 1); + wredrawln(midwin, editwinrows - 1 , 1); lastmessage = VACUUM; spotlighted = FALSE; update_line(openfile->current, openfile->current_x); - wnoutrefresh(edit); + wnoutrefresh(midwin); curs_set(1); } if (ISSET(MINIBAR) && !ISSET(ZERO) && LINES > 1) @@ -1282,7 +1282,7 @@ int get_kbinput(WINDOW *frame, bool showcursor) kbinput = parse_kbinput(frame); /* If we read from the edit window, blank the status bar if needed. */ - if (frame == edit) + if (frame == midwin) check_statusblank(); return kbinput; @@ -1495,7 +1495,7 @@ char *get_verbatim_kbinput(WINDOW *frame, size_t *count) fflush(stdout); if (ISSET(ZERO) && currmenu == MMAIN) - wredrawln(edit, editwinrows - 1, 1); + wredrawln(midwin, editwinrows - 1, 1); #endif /* Turn flow control characters back on if necessary and turn the @@ -1506,7 +1506,7 @@ char *get_verbatim_kbinput(WINDOW *frame, size_t *count) /* Use the global window pointers, because a resize may have freed * the data that the frame parameter points to. */ if (!ISSET(RAW_SEQUENCES)) { - keypad(edit, TRUE); + keypad(midwin, TRUE); keypad(bottomwin, TRUE); } @@ -1542,7 +1542,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts) if (getmouse(&event) == ERR) return -1; - in_editwin = wenclose(edit, event.y, event.x); + in_editwin = wenclose(midwin, event.y, event.x); in_bottomwin = wenclose(bottomwin, event.y, event.x); /* Save the screen coordinates where the mouse event took place. */ @@ -1623,7 +1623,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts) * mouse wheel) and presses of the fifth mouse button (downward * rolls of the mouse wheel) . */ else if (event.bstate & (BUTTON4_PRESSED | BUTTON5_PRESSED)) { - bool in_edit = wenclose(edit, *mouse_y, *mouse_x); + bool in_edit = wenclose(midwin, *mouse_y, *mouse_x); if (in_bottomwin) /* Translate the coordinates to become relative to bottomwin. */ @@ -1665,7 +1665,7 @@ void blank_titlebar(void) void blank_edit(void) { for (int row = 0; row < editwinrows; row++) - blank_row(edit, row); + blank_row(midwin, row); } /* Blank the first line of the bottom portion of the screen. */ @@ -1706,8 +1706,8 @@ void check_statusblank(void) /* When windows overlap, make sure to show the edit window now. */ if (currmenu == MMAIN && (ISSET(ZERO) || LINES == 1)) { - wredrawln(edit, editwinrows - 1, 1); - wnoutrefresh(edit); + wredrawln(midwin, editwinrows - 1, 1); + wnoutrefresh(midwin); } } @@ -2279,7 +2279,7 @@ void statusline(message_type importance, const char *msg, ...) /* On a one-row terminal, ensure that any changes in the edit window are * written out first, to prevent them from overwriting the message. */ if (LINES == 1 && importance < INFO) - wnoutrefresh(edit); + wnoutrefresh(midwin); /* If there are multiple alert messages, add trailing dots to the first. */ if (lastmessage == ALERT) { @@ -2469,7 +2469,7 @@ void place_the_cursor(void) } if (row < editwinrows) - wmove(edit, row, margin + column); + wmove(midwin, row, margin + column); #ifndef NANO_TINY else statusline(ALERT, "Misplaced cursor -- please report a bug"); @@ -2488,39 +2488,39 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) /* If line numbering is switched on, put a line number in front of * the text -- but only for the parts that are not softwrapped. */ if (margin > 0) { - wattron(edit, interface_color_pair[LINE_NUMBER]); + wattron(midwin, interface_color_pair[LINE_NUMBER]); #ifndef NANO_TINY if (ISSET(SOFTWRAP) && from_col != 0) - mvwprintw(edit, row, 0, "%*s", margin - 1, " "); + mvwprintw(midwin, row, 0, "%*s", margin - 1, " "); else #endif - mvwprintw(edit, row, 0, "%*zd", margin - 1, line->lineno); - wattroff(edit, interface_color_pair[LINE_NUMBER]); + mvwprintw(midwin, row, 0, "%*zd", margin - 1, line->lineno); + wattroff(midwin, interface_color_pair[LINE_NUMBER]); #ifndef NANO_TINY if (line->has_anchor && (from_col == 0 || !ISSET(SOFTWRAP))) #ifdef ENABLE_UTF8 if (using_utf8()) - wprintw(edit, "\xE2\xAC\xA5"); /* black medium diamond */ + wprintw(midwin, "\xE2\xAC\xA5"); /* black medium diamond */ else #endif - wprintw(edit, "+"); + wprintw(midwin, "+"); else #endif - wprintw(edit, " "); + wprintw(midwin, " "); } #endif /* ENABLE_LINENUMBERS */ /* First simply write the converted line -- afterward we'll add colors * and the marking highlight on just the pieces that need it. */ - mvwaddstr(edit, row, margin, converted); + mvwaddstr(midwin, row, margin, converted); /* When needed, clear the remainder of the row. */ if (is_shorter || ISSET(SOFTWRAP)) - wclrtoeol(edit); + wclrtoeol(midwin); #ifndef NANO_TINY if (thebar) - mvwaddch(edit, row, COLS - 1, bardata[row]); + mvwaddch(midwin, row, COLS - 1, bardata[row]); #endif #ifdef ENABLE_COLOR @@ -2588,9 +2588,9 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) paintlen = actual_x(thetext, wideness(line->data, match.rm_eo) - from_col - start_col); - wattron(edit, varnish->attributes); - mvwaddnstr(edit, row, margin + start_col, thetext, paintlen); - wattroff(edit, varnish->attributes); + wattron(midwin, varnish->attributes); + mvwaddnstr(midwin, row, margin + start_col, thetext, paintlen); + wattroff(midwin, varnish->attributes); } continue; @@ -2688,9 +2688,9 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) /* If the end is on a later line, paint whole line, and be done. */ if (end_line != line) { - wattron(edit, varnish->attributes); - mvwaddnstr(edit, row, margin, converted, -1); - wattroff(edit, varnish->attributes); + wattron(midwin, varnish->attributes); + mvwaddnstr(midwin, row, margin, converted, -1); + wattroff(midwin, varnish->attributes); line->multidata[varnish->id] = WHOLELINE; continue; } @@ -2699,9 +2699,9 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) if (endmatch.rm_eo > from_x) { paintlen = actual_x(converted, wideness(line->data, endmatch.rm_eo) - from_col); - wattron(edit, varnish->attributes); - mvwaddnstr(edit, row, margin, converted, paintlen); - wattroff(edit, varnish->attributes); + wattron(midwin, varnish->attributes); + mvwaddnstr(midwin, row, margin, converted, paintlen); + wattroff(midwin, varnish->attributes); } line->multidata[varnish->id] = ENDSHERE; @@ -2732,9 +2732,9 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) paintlen = actual_x(thetext, wideness(line->data, endmatch.rm_eo) - from_col - start_col); - wattron(edit, varnish->attributes); - mvwaddnstr(edit, row, margin + start_col, thetext, paintlen); - wattroff(edit, varnish->attributes); + wattron(midwin, varnish->attributes); + mvwaddnstr(midwin, row, margin + start_col, thetext, paintlen); + wattroff(midwin, varnish->attributes); line->multidata[varnish->id] = JUSTONTHIS; } @@ -2763,9 +2763,9 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) } /* Paint the rest of the line, and we're done. */ - wattron(edit, varnish->attributes); - mvwaddnstr(edit, row, margin + start_col, thetext, -1); - wattroff(edit, varnish->attributes); + wattron(midwin, varnish->attributes); + mvwaddnstr(midwin, row, margin + start_col, thetext, -1); + wattroff(midwin, varnish->attributes); line->multidata[varnish->id] = STARTSHERE; @@ -2809,9 +2809,9 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) } else striped_char[0] = ' '; - wattron(edit, interface_color_pair[GUIDE_STRIPE]); - mvwaddnstr(edit, row, margin + target_column, striped_char, charlen); - wattroff(edit, interface_color_pair[GUIDE_STRIPE]); + wattron(midwin, interface_color_pair[GUIDE_STRIPE]); + mvwaddnstr(midwin, row, margin + target_column, striped_char, charlen); + wattroff(midwin, interface_color_pair[GUIDE_STRIPE]); } /* If the line is at least partially selected, paint the marked part. */ @@ -2854,9 +2854,9 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) paintlen = actual_x(thetext, end_col - start_col); } - wattron(edit, interface_color_pair[SELECTED_TEXT]); - mvwaddnstr(edit, row, margin + start_col, thetext, paintlen); - wattroff(edit, interface_color_pair[SELECTED_TEXT]); + wattron(midwin, interface_color_pair[SELECTED_TEXT]); + mvwaddnstr(midwin, row, margin + start_col, thetext, paintlen); + wattroff(midwin, interface_color_pair[SELECTED_TEXT]); } } #endif /* !NANO_TINY */ @@ -2890,14 +2890,14 @@ int update_line(linestruct *line, size_t index) free(converted); if (from_col > 0) { - wattron(edit, hilite_attribute); - mvwaddch(edit, row, margin, '<'); - wattroff(edit, hilite_attribute); + wattron(midwin, hilite_attribute); + mvwaddch(midwin, row, margin, '<'); + wattroff(midwin, hilite_attribute); } if (has_more) { - wattron(edit, hilite_attribute); - mvwaddch(edit, row, COLS - 1 - thebar, '>'); - wattroff(edit, hilite_attribute); + wattron(midwin, hilite_attribute); + mvwaddch(midwin, row, COLS - 1 - thebar, '>'); + wattroff(midwin, hilite_attribute); } if (spotlighted && line == openfile->current) @@ -3105,7 +3105,7 @@ void draw_scrollbar(void) for (int row = 0; row < editwinrows; row++) { bardata[row] = ' '|interface_color_pair[SCROLL_BAR]| ((row < lowest || row > highest) ? A_NORMAL : A_REVERSE); - mvwaddch(edit, row, COLS - 1, bardata[row]); + mvwaddch(midwin, row, COLS - 1, bardata[row]); } } #endif @@ -3125,9 +3125,9 @@ void edit_scroll(bool direction) go_forward_chunks(1, &openfile->edittop, &openfile->firstcolumn); /* Actually scroll the text of the edit window one row up or down. */ - scrollok(edit, TRUE); - wscrl(edit, (direction == BACKWARD) ? -1 : 1); - scrollok(edit, FALSE); + scrollok(midwin, TRUE); + wscrl(midwin, (direction == BACKWARD) ? -1 : 1); + scrollok(midwin, FALSE); /* If we're not on the first "page" (when not softwrapping), or the mark * is on, the row next to the scrolled region needs to be redrawn too. */ @@ -3434,10 +3434,10 @@ void edit_refresh(void) } while (row < editwinrows) { - blank_row(edit, row); + blank_row(midwin, row); #ifndef NANO_TINY if (thebar) - mvwaddch(edit, row, COLS - 1, bardata[row]); + mvwaddch(midwin, row, COLS - 1, bardata[row]); #endif row++; } @@ -3447,7 +3447,7 @@ void edit_refresh(void) #endif place_the_cursor(); - wnoutrefresh(edit); + wnoutrefresh(midwin); refresh_needed = FALSE; } @@ -3552,11 +3552,11 @@ void spotlight(size_t from_col, size_t to_col) word = display_string(openfile->current->data, from_col, to_col - from_col, FALSE, overshoots); - wattron(edit, interface_color_pair[SPOTLIGHTED]); - waddnstr(edit, word, actual_x(word, to_col)); + wattron(midwin, interface_color_pair[SPOTLIGHTED]); + waddnstr(midwin, word, actual_x(word, to_col)); if (overshoots) - mvwaddch(edit, openfile->current_y, COLS - 1 - thebar, '>'); - wattroff(edit, interface_color_pair[SPOTLIGHTED]); + mvwaddch(midwin, openfile->current_y, COLS - 1 - thebar, '>'); + wattroff(midwin, interface_color_pair[SPOTLIGHTED]); free(word); } @@ -3592,16 +3592,16 @@ void spotlight_softwrapped(size_t from_col, size_t to_col) word = display_string(openfile->current->data, from_col, break_col - from_col, FALSE, FALSE); - wattron(edit, interface_color_pair[SPOTLIGHTED]); - waddnstr(edit, word, actual_x(word, break_col)); - wattroff(edit, interface_color_pair[SPOTLIGHTED]); + wattron(midwin, interface_color_pair[SPOTLIGHTED]); + waddnstr(midwin, word, actual_x(word, break_col)); + wattroff(midwin, interface_color_pair[SPOTLIGHTED]); free(word); if (end_of_line) break; - wmove(edit, ++row, margin); + wmove(midwin, ++row, margin); leftedge = break_col; from_col = break_col; @@ -3695,15 +3695,15 @@ void do_credits(void) window_init(); } - nodelay(edit, TRUE); - scrollok(edit, TRUE); + nodelay(midwin, TRUE); + scrollok(midwin, TRUE); blank_titlebar(); blank_edit(); blank_statusbar(); wrefresh(topwin); - wrefresh(edit); + wrefresh(midwin); wrefresh(bottomwin); napms(700); @@ -3716,24 +3716,24 @@ void do_credits(void) else what = credits[crpos]; - mvwaddstr(edit, editwinrows - 1 - (editwinrows % 2), + mvwaddstr(midwin, editwinrows - 1 - (editwinrows % 2), COLS / 2 - breadth(what) / 2 - 1, what); - wrefresh(edit); + wrefresh(midwin); } - if ((kbinput = wgetch(edit)) != ERR) + if ((kbinput = wgetch(midwin)) != ERR) break; napms(700); - wscrl(edit, 1); - wrefresh(edit); + wscrl(midwin, 1); + wrefresh(midwin); - if ((kbinput = wgetch(edit)) != ERR) + if ((kbinput = wgetch(midwin)) != ERR) break; napms(700); - wscrl(edit, 1); - wrefresh(edit); + wscrl(midwin, 1); + wrefresh(midwin); } if (kbinput != ERR) @@ -3745,8 +3745,8 @@ void do_credits(void) UNSET(NO_HELP); window_init(); - scrollok(edit, FALSE); - nodelay(edit, FALSE); + scrollok(midwin, FALSE); + nodelay(midwin, FALSE); draw_all_subwindows(); }