tweaks: normalize the indentation after the previous change
Also rewrap two lines, reshuffle three, and improve three comments.master
parent
b3faf353c9
commit
3c4a4b04ce
23
src/nano.c
23
src/nano.c
|
@ -1669,14 +1669,10 @@ void inject(char *burst, size_t count)
|
|||
memmove(openfile->current->data + openfile->current_x + count,
|
||||
openfile->current->data + openfile->current_x,
|
||||
current_len - openfile->current_x + 1);
|
||||
strncpy(openfile->current->data + openfile->current_x,
|
||||
burst, count);
|
||||
|
||||
openfile->totsize += mbstrlen(burst);
|
||||
set_modified();
|
||||
strncpy(openfile->current->data + openfile->current_x, burst, count);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Note that current_x has not yet been incremented. */
|
||||
/* When the mark is to the right of the cursor, compensate its position. */
|
||||
if (openfile->current == openfile->mark &&
|
||||
openfile->current_x < openfile->mark_x)
|
||||
openfile->mark_x += count;
|
||||
|
@ -1684,28 +1680,29 @@ void inject(char *burst, size_t count)
|
|||
/* When the cursor is on the top row and not on the first chunk
|
||||
* of a line, adding text there might change the preceding chunk
|
||||
* and thus require an adjustment of firstcolumn. */
|
||||
if (openfile->current == openfile->edittop &&
|
||||
openfile->firstcolumn > 0) {
|
||||
if (openfile->current == openfile->edittop && openfile->firstcolumn > 0) {
|
||||
ensure_firstcolumn_is_aligned();
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
openfile->current_x += count;
|
||||
|
||||
/* If we've added text to the magic line, create a new magic line. */
|
||||
/* If text was added to the magic line, create a new magic line. */
|
||||
if (openfile->filebot == openfile->current && !ISSET(NO_NEWLINES)) {
|
||||
new_magicline();
|
||||
if (margin > 0)
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
|
||||
openfile->current_x += count;
|
||||
|
||||
openfile->totsize += mbstrlen(burst);
|
||||
set_modified();
|
||||
|
||||
#ifndef NANO_TINY
|
||||
update_undo(ADD);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_WRAPPING
|
||||
/* If text gets wrapped, the edit window needs a refresh. */
|
||||
/* Wrap the line when needed, and if so, schedule a refresh. */
|
||||
if (ISSET(BREAK_LONG_LINES) && do_wrap())
|
||||
refresh_needed = TRUE;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue