still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2188 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
e750fe68cf
commit
6a2f068c7f
12
src/nano.c
12
src/nano.c
|
@ -1476,6 +1476,7 @@ bool do_wrap(filestruct *inptr)
|
||||||
/* after_break is the text that will be moved to the next line. */
|
/* after_break is the text that will be moved to the next line. */
|
||||||
after_break = inptr->data + wrap_loc + 1;
|
after_break = inptr->data + wrap_loc + 1;
|
||||||
after_break_len = len - wrap_loc - 1;
|
after_break_len = len - wrap_loc - 1;
|
||||||
|
|
||||||
assert(after_break_len == strlen(after_break));
|
assert(after_break_len == strlen(after_break));
|
||||||
|
|
||||||
/* new_line_len will later be increased by the lengths of indentation
|
/* new_line_len will later be increased by the lengths of indentation
|
||||||
|
@ -1525,6 +1526,7 @@ bool do_wrap(filestruct *inptr)
|
||||||
#endif
|
#endif
|
||||||
strcat(newline, after_break);
|
strcat(newline, after_break);
|
||||||
new_line_len += after_break_len;
|
new_line_len += after_break_len;
|
||||||
|
|
||||||
/* We end the old line after wrap_loc. Note that this does not eat
|
/* We end the old line after wrap_loc. Note that this does not eat
|
||||||
* the space. */
|
* the space. */
|
||||||
null_at(&inptr->data, wrap_loc + 1);
|
null_at(&inptr->data, wrap_loc + 1);
|
||||||
|
@ -1554,6 +1556,7 @@ bool do_wrap(filestruct *inptr)
|
||||||
temp->prev = inptr;
|
temp->prev = inptr;
|
||||||
temp->next = inptr->next;
|
temp->next = inptr->next;
|
||||||
temp->prev->next = temp;
|
temp->prev->next = temp;
|
||||||
|
|
||||||
/* If temp->next is NULL, then temp is the last line of the
|
/* If temp->next is NULL, then temp is the last line of the
|
||||||
* file, so we must set filebot. */
|
* file, so we must set filebot. */
|
||||||
if (temp->next != NULL)
|
if (temp->next != NULL)
|
||||||
|
@ -1927,7 +1930,6 @@ const char *do_int_speller(const char *tempfile_name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
close_pipes_and_exit:
|
close_pipes_and_exit:
|
||||||
|
|
||||||
/* Don't leak any handles. */
|
/* Don't leak any handles. */
|
||||||
close(tempfile_fd);
|
close(tempfile_fd);
|
||||||
close(spell_fd[0]);
|
close(spell_fd[0]);
|
||||||
|
@ -2009,10 +2011,11 @@ const char *do_alt_speller(char *tempfile_name)
|
||||||
/* Wait for alternate speller to complete. */
|
/* Wait for alternate speller to complete. */
|
||||||
wait(&alt_spell_status);
|
wait(&alt_spell_status);
|
||||||
|
|
||||||
if (!WIFEXITED(alt_spell_status) || WEXITSTATUS(alt_spell_status) != 0) {
|
if (!WIFEXITED(alt_spell_status) ||
|
||||||
|
WEXITSTATUS(alt_spell_status) != 0) {
|
||||||
char *altspell_error = NULL;
|
char *altspell_error = NULL;
|
||||||
char *invoke_error = _("Could not invoke \"%s\"");
|
char *invoke_error = _("Could not invoke \"%s\"");
|
||||||
int msglen = strlen(invoke_error) + strlen(alt_speller) + 2;
|
int msglen = strlenpt(invoke_error) + strlenpt(alt_speller) + 2;
|
||||||
|
|
||||||
altspell_error = charalloc(msglen);
|
altspell_error = charalloc(msglen);
|
||||||
snprintf(altspell_error, msglen, invoke_error, alt_speller);
|
snprintf(altspell_error, msglen, invoke_error, alt_speller);
|
||||||
|
@ -2291,8 +2294,9 @@ size_t quote_length(const char *line)
|
||||||
bool quotes_match(const char *a_line, size_t a_quote, const char
|
bool quotes_match(const char *a_line, size_t a_quote, const char
|
||||||
*b_line)
|
*b_line)
|
||||||
{
|
{
|
||||||
/* Here is the assumption about a_quote: */
|
/* Here is the assumption about a_quote. */
|
||||||
assert(a_quote == quote_length(a_line));
|
assert(a_quote == quote_length(a_line));
|
||||||
|
|
||||||
return a_quote == quote_length(b_line) &&
|
return a_quote == quote_length(b_line) &&
|
||||||
strncmp(a_line, b_line, a_quote) == 0;
|
strncmp(a_line, b_line, a_quote) == 0;
|
||||||
}
|
}
|
||||||
|
|
13
src/winio.c
13
src/winio.c
|
@ -416,8 +416,7 @@ int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
|
||||||
)
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
static int escapes = 0;
|
static int escapes = 0, word_digits = 0;
|
||||||
static int word_digits = 0;
|
|
||||||
buffer *kbinput;
|
buffer *kbinput;
|
||||||
int retval = ERR;
|
int retval = ERR;
|
||||||
|
|
||||||
|
@ -600,7 +599,7 @@ int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
|
||||||
|
|
||||||
/* Put back the non-escape character, get
|
/* Put back the non-escape character, get
|
||||||
* the complete escape sequence, translate
|
* the complete escape sequence, translate
|
||||||
* its key values into the corresponding key
|
* the sequence into its corresponding key
|
||||||
* value, and save that as the result. */
|
* value, and save that as the result. */
|
||||||
unget_input(kbinput, 1);
|
unget_input(kbinput, 1);
|
||||||
seq_len = get_buffer_len();
|
seq_len = get_buffer_len();
|
||||||
|
@ -1226,16 +1225,15 @@ int get_escape_seq_abcd(int kbinput)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Translate a word sequence: turn a three-digit decimal number from
|
/* Translate a word sequence: turn a five-digit decimal number from
|
||||||
* 000 to 255 into its corresponding word value. */
|
* 00000 to 65535 into its corresponding word value. */
|
||||||
int get_word_kbinput(int kbinput
|
int get_word_kbinput(int kbinput
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
, bool reset
|
, bool reset
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
static int word_digits = 0;
|
static int word_digits = 0, word_kbinput = 0;
|
||||||
static int word_kbinput = 0;
|
|
||||||
int retval = ERR;
|
int retval = ERR;
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
|
@ -1424,6 +1422,7 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
|
||||||
|
|
||||||
while (word == ERR) {
|
while (word == ERR) {
|
||||||
while ((kbinput = get_input(win, 1)) == NULL);
|
while ((kbinput = get_input(win, 1)) == NULL);
|
||||||
|
|
||||||
word = get_word_kbinput(kbinput->key
|
word = get_word_kbinput(kbinput->key
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
, FALSE
|
, FALSE
|
||||||
|
|
Loading…
Reference in New Issue