weeding: drop the forreal parameter from place_the_cursor()

Commit 28beb3f added the 'forreal' parameter to prevent spotlight() from
placing the cursor wrongly due to an invalid placewewant.  However, since
the variable-width softwrap overhaul (specifically, since commit 8490f4a),
place_the_cursor() no longer checks placewewant, so the parameter is no
longer needed.

Furthermore, dropping 'forreal' and thus always setting current_y won't
affect the operation of spotlight(), since the only functions that use
spotlight() (do_replace_loop() and do_int_spell_fix()) both call
edit_refresh() beforehand, which means that current_y will already
have been set to the value it will be set to again.
master
David Lawrence Ramsey 2017-07-21 23:26:59 -05:00 committed by Benno Schulenberg
parent 6f9bb53b2d
commit 381a386b01
4 changed files with 10 additions and 11 deletions

View File

@ -2626,7 +2626,7 @@ int main(int argc, char **argv)
/* Refresh just the cursor position or the entire edit window. */
if (!refresh_needed) {
place_the_cursor(TRUE);
place_the_cursor();
wnoutrefresh(edit);
} else
edit_refresh();

View File

@ -649,7 +649,7 @@ void warn_and_shortly_pause(const char *msg);
void statusline(message_type importance, const char *msg, ...);
void bottombars(int menu);
void onekey(const char *keystroke, const char *desc, int length);
void place_the_cursor(bool forreal);
void place_the_cursor(void);
void edit_draw(filestruct *fileptr, const char *converted,
int line, size_t from_col);
int update_line(filestruct *fileptr, size_t index);

View File

@ -2443,7 +2443,7 @@ void do_justify(bool full_justify)
do {
#endif
statusbar(_("Can now UnJustify!"));
place_the_cursor(TRUE);
place_the_cursor();
curs_set(1);
kbinput = do_input(FALSE);
#ifndef NANO_TINY
@ -3313,7 +3313,7 @@ void do_linter(void)
}
/* Place and show the cursor to indicate the affected line. */
place_the_cursor(TRUE);
place_the_cursor();
wnoutrefresh(edit);
curs_set(1);
@ -3561,7 +3561,7 @@ void do_verbatim_input(void)
/* TRANSLATORS: This is displayed when the next keystroke will be
* inserted verbatim. */
statusbar(_("Verbatim Input"));
place_the_cursor(TRUE);
place_the_cursor();
curs_set(1);
/* Read in all the verbatim characters. */

View File

@ -1252,7 +1252,7 @@ int parse_escape_sequence(WINDOW *win, int kbinput)
suppress_cursorpos = FALSE;
lastmessage = HUSH;
if (currmenu == MMAIN) {
place_the_cursor(TRUE);
place_the_cursor();
curs_set(1);
}
}
@ -2275,7 +2275,7 @@ void onekey(const char *keystroke, const char *desc, int length)
/* Redetermine current_y from the position of current relative to edittop,
* and put the cursor in the edit window at (current_y, "current_x"). */
void place_the_cursor(bool forreal)
void place_the_cursor(void)
{
ssize_t row = 0;
size_t col, xpt = xplustabs();
@ -2306,8 +2306,7 @@ void place_the_cursor(bool forreal)
if (row < editwinrows)
wmove(edit, row, margin + col);
if (forreal)
openfile->current_y = row;
openfile->current_y = row;
}
/* edit_draw() takes care of the job of actually painting a line into
@ -3241,7 +3240,7 @@ void edit_refresh(void)
while (row < editwinrows)
blank_row(edit, row++, 0, COLS);
place_the_cursor(TRUE);
place_the_cursor();
wnoutrefresh(edit);
refresh_needed = FALSE;
@ -3394,7 +3393,7 @@ void spotlight(bool active, size_t from_col, size_t to_col)
char *word;
size_t word_span, room;
place_the_cursor(FALSE);
place_the_cursor();
#ifndef NANO_TINY
if (ISSET(SOFTWRAP)) {