- Simplify wording of nano_gotoline_msg. (Jordi)
- nano.c:
do_verbatim_input()
- - If constant cursor position display is on when we finish, make
- sure the cursor position is displayed properly. (DLR)
+ - If constant cursor position display is on, make sure the
+ cursor position is displayed properly when we finish. (DLR)
+ do_next_word()
+ - Rework to be more like do_prev_word(), to avoid a potential
+ problem if we start at the end of a line. (DLR)
do_alt_speller()
- If we can't invoke the spell checker, use sprintf() instead of
snprintf() to write the error string we return, as the one
no longer needed, and make the error message more similar to
what the internal spell checker returns under the same
circumstances. (DLR)
+ do_justify()
+ - If constant cursor position display is on, make sure the
+ cursor position is displayed properly when we finish. (DLR)
allow_pending_sigwinch()
- Simplify by using the "?" operator instead of an if clause.
(DLR)
- Blank out last_replace properly again just before displaying
the "Replace" prompt. (DLR, found by Mike Frysinger)
- winio.c:
+ do_statusbar_next_word()
+ - Rework to be more like do_statusbar_prev_word(), to avoid a
+ potential problem if we start at the end of a line. (DLR)
display_string()
- Display invalid multibyte sequences as Unicode 0xFFFD
(Replacement Character). (DLR)
statusbar(_("Verbatim Input"));
+ /* If constant cursor position display is on, make sure the current
+ * cursor position will be properly displayed on the statusbar. */
+ if (ISSET(CONST_UPDATE))
+ do_cursorpos(TRUE);
+
/* Read in all the verbatim characters. */
kbinput = get_verbatim_kbinput(edit, &kbinput_len);
do_output(output, kbinput_len, TRUE);
free(output);
-
- /* If constant cursor position display is on, make sure the current
- * cursor position is properly displayed on the statusbar. */
- if (ISSET(CONST_UPDATE))
- do_cursorpos(TRUE);
}
void do_backspace(void)
const filestruct *current_save = current;
char *char_mb;
int char_mb_len;
- bool started_on_word = FALSE;
+ bool end_line = FALSE, started_on_word = FALSE;
assert(current != NULL && current->data != NULL);
/* Move forward until we find the character after the last letter of
* the current word. */
- while (current->data[current_x] != '\0') {
+ while (!end_line) {
char_mb_len = parse_mbchar(current->data + current_x, char_mb,
NULL, NULL);
* started_on_word to TRUE. */
started_on_word = TRUE;
- current_x += char_mb_len;
+ if (current->data[current_x] == '\0')
+ end_line = TRUE;
+ else
+ current_x += char_mb_len;
}
/* Move forward until we find the first letter of the next word. */
- if (current->data[current_x] != '\0')
+ if (current->data[current_x] == '\0')
+ end_line = TRUE;
+ else
current_x += char_mb_len;
for (; current != NULL; current = current->next) {
- while (current->data[current_x] != '\0') {
+ while (!end_line) {
char_mb_len = parse_mbchar(current->data + current_x,
char_mb, NULL, NULL);
if (is_word_mbchar(char_mb, allow_punct))
break;
- current_x += char_mb_len;
+ if (current->data[current_x] == '\0')
+ end_line = TRUE;
+ else
+ current_x += char_mb_len;
}
/* If we've found it, stop moving forward to the beginnings of
* subsequent lines. */
- if (current->data[current_x] != '\0')
+ if (!end_line)
break;
- current_x = 0;
+ if (current->next != NULL) {
+ end_line = FALSE;
+ current_x = 0;
+ }
}
free(char_mb);
/* If we haven't found it, leave the cursor at the beginning of the
* file. */
- if (current == NULL) {
+ if (current == NULL)
current = fileage;
- current_x = 0;
/* If we've found it, move backward until we find the character
* before the first letter of the previous word. */
- } else if (!begin_line) {
+ else if (!begin_line) {
if (current_x == 0)
begin_line = TRUE;
else
statusbar(_("Can now UnJustify!"));
+ /* If constant cursor position display is on, make sure the current
+ * cursor position will be properly displayed on the statusbar. */
+ if (ISSET(CONST_UPDATE))
+ do_cursorpos(TRUE);
+
/* Display the shortcut list with UnJustify. */
shortcut_init(TRUE);
display_main_list();
{
char *char_mb;
int char_mb_len;
- bool started_on_word = FALSE;
+ bool end_line = FALSE, started_on_word = FALSE;
assert(answer != NULL);
/* Move forward until we find the character after the last letter of
* the current word. */
- while (answer[statusbar_x] != '\0') {
+ while (!end_line) {
char_mb_len = parse_mbchar(answer + statusbar_x, char_mb, NULL,
NULL);
* started_on_word to TRUE. */
started_on_word = TRUE;
- statusbar_x += char_mb_len;
+ if (answer[statusbar_x] == '\0')
+ end_line = TRUE;
+ else
+ statusbar_x += char_mb_len;
}
/* Move forward until we find the first letter of the next word. */
- if (answer[statusbar_x] != '\0')
+ if (answer[statusbar_x] == '\0')
+ end_line = TRUE;
+ else
statusbar_x += char_mb_len;
- while (answer[statusbar_x] != '\0') {
+ while (!end_line) {
char_mb_len = parse_mbchar(answer + statusbar_x, char_mb, NULL,
NULL);
if (is_word_mbchar(char_mb, allow_punct))
break;
- statusbar_x += char_mb_len;
+ if (answer[statusbar_x] == '\0')
+ end_line = TRUE;
+ else
+ statusbar_x += char_mb_len;
}
free(char_mb);