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.
Этот коммит содержится в:
родитель
6f9bb53b2d
Коммит
381a386b01
@ -2626,7 +2626,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Refresh just the cursor position or the entire edit window. */
|
/* Refresh just the cursor position or the entire edit window. */
|
||||||
if (!refresh_needed) {
|
if (!refresh_needed) {
|
||||||
place_the_cursor(TRUE);
|
place_the_cursor();
|
||||||
wnoutrefresh(edit);
|
wnoutrefresh(edit);
|
||||||
} else
|
} else
|
||||||
edit_refresh();
|
edit_refresh();
|
||||||
|
@ -649,7 +649,7 @@ void warn_and_shortly_pause(const char *msg);
|
|||||||
void statusline(message_type importance, const char *msg, ...);
|
void statusline(message_type importance, const char *msg, ...);
|
||||||
void bottombars(int menu);
|
void bottombars(int menu);
|
||||||
void onekey(const char *keystroke, const char *desc, int length);
|
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,
|
void edit_draw(filestruct *fileptr, const char *converted,
|
||||||
int line, size_t from_col);
|
int line, size_t from_col);
|
||||||
int update_line(filestruct *fileptr, size_t index);
|
int update_line(filestruct *fileptr, size_t index);
|
||||||
|
@ -2443,7 +2443,7 @@ void do_justify(bool full_justify)
|
|||||||
do {
|
do {
|
||||||
#endif
|
#endif
|
||||||
statusbar(_("Can now UnJustify!"));
|
statusbar(_("Can now UnJustify!"));
|
||||||
place_the_cursor(TRUE);
|
place_the_cursor();
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
kbinput = do_input(FALSE);
|
kbinput = do_input(FALSE);
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
@ -3313,7 +3313,7 @@ void do_linter(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Place and show the cursor to indicate the affected line. */
|
/* Place and show the cursor to indicate the affected line. */
|
||||||
place_the_cursor(TRUE);
|
place_the_cursor();
|
||||||
wnoutrefresh(edit);
|
wnoutrefresh(edit);
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
|
|
||||||
@ -3561,7 +3561,7 @@ void do_verbatim_input(void)
|
|||||||
/* TRANSLATORS: This is displayed when the next keystroke will be
|
/* TRANSLATORS: This is displayed when the next keystroke will be
|
||||||
* inserted verbatim. */
|
* inserted verbatim. */
|
||||||
statusbar(_("Verbatim Input"));
|
statusbar(_("Verbatim Input"));
|
||||||
place_the_cursor(TRUE);
|
place_the_cursor();
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
|
|
||||||
/* Read in all the verbatim characters. */
|
/* Read in all the verbatim characters. */
|
||||||
|
@ -1252,7 +1252,7 @@ int parse_escape_sequence(WINDOW *win, int kbinput)
|
|||||||
suppress_cursorpos = FALSE;
|
suppress_cursorpos = FALSE;
|
||||||
lastmessage = HUSH;
|
lastmessage = HUSH;
|
||||||
if (currmenu == MMAIN) {
|
if (currmenu == MMAIN) {
|
||||||
place_the_cursor(TRUE);
|
place_the_cursor();
|
||||||
curs_set(1);
|
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,
|
/* Redetermine current_y from the position of current relative to edittop,
|
||||||
* and put the cursor in the edit window at (current_y, "current_x"). */
|
* 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;
|
ssize_t row = 0;
|
||||||
size_t col, xpt = xplustabs();
|
size_t col, xpt = xplustabs();
|
||||||
@ -2306,7 +2306,6 @@ void place_the_cursor(bool forreal)
|
|||||||
if (row < editwinrows)
|
if (row < editwinrows)
|
||||||
wmove(edit, row, margin + col);
|
wmove(edit, row, margin + col);
|
||||||
|
|
||||||
if (forreal)
|
|
||||||
openfile->current_y = row;
|
openfile->current_y = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3241,7 +3240,7 @@ void edit_refresh(void)
|
|||||||
while (row < editwinrows)
|
while (row < editwinrows)
|
||||||
blank_row(edit, row++, 0, COLS);
|
blank_row(edit, row++, 0, COLS);
|
||||||
|
|
||||||
place_the_cursor(TRUE);
|
place_the_cursor();
|
||||||
wnoutrefresh(edit);
|
wnoutrefresh(edit);
|
||||||
|
|
||||||
refresh_needed = FALSE;
|
refresh_needed = FALSE;
|
||||||
@ -3394,7 +3393,7 @@ void spotlight(bool active, size_t from_col, size_t to_col)
|
|||||||
char *word;
|
char *word;
|
||||||
size_t word_span, room;
|
size_t word_span, room;
|
||||||
|
|
||||||
place_the_cursor(FALSE);
|
place_the_cursor();
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (ISSET(SOFTWRAP)) {
|
if (ISSET(SOFTWRAP)) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user