diff --git a/src/cut.c b/src/cut.c index 9079ce97..6793798b 100644 --- a/src/cut.c +++ b/src/cut.c @@ -34,7 +34,7 @@ void do_deletion(undo_type action) int charlen = char_length(openfile->current->data + openfile->current_x); size_t line_len = strlen(openfile->current->data + openfile->current_x); #ifndef NANO_TINY - size_t old_amount = extra_chunks_in(openfile->current); + size_t old_amount = ISSET(SOFTWRAP) ? extra_chunks_in(openfile->current) : 0; /* If the type of action changed or the cursor moved to a different * line, create a new undo item, otherwise update the existing item. */ diff --git a/src/nano.c b/src/nano.c index 1011148f..4f151bce 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1399,12 +1399,13 @@ void inject(char *burst, size_t count) linestruct *thisline = openfile->current; size_t datalen = strlen(thisline->data); #ifndef NANO_TINY - size_t old_amount = extra_chunks_in(openfile->current); size_t original_row = 0; + size_t old_amount = 0; if (ISSET(SOFTWRAP)) { if (openfile->current_y == editwinrows - 1) original_row = chunk_for(xplustabs(), thisline); + old_amount = extra_chunks_in(thisline); } #endif