Commit 4ea55c3b authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Renaming two variables for clarity.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5459 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 7 additions and 6 deletions
+7 -6
2015-12-01 Benno Schulenberg <bensberg@justemail.net> 2015-12-01 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (do_insertfile): Mark the buffer as mofified only when * src/files.c (do_insertfile): Mark the buffer as mofified only when
actually something was inserted. This fixes Savannah bug #45409. actually something was inserted. This fixes Savannah bug #45409.
* src/files.c (do_insertfile): Rename two variables for clarity.
2015-11-30 Benno Schulenberg <bensberg@justemail.net> 2015-11-30 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (redo_cut, update_undo): When cutting reaches the EOF, * src/text.c (redo_cut, update_undo): When cutting reaches the EOF,
......
...@@ -1042,8 +1042,8 @@ void do_insertfile( ...@@ -1042,8 +1042,8 @@ void do_insertfile(
/* The last answer the user typed at the statusbar prompt. */ /* The last answer the user typed at the statusbar prompt. */
filestruct *edittop_save = openfile->edittop; filestruct *edittop_save = openfile->edittop;
ssize_t was_current_lineno = openfile->current->lineno; ssize_t was_current_lineno = openfile->current->lineno;
size_t current_x_save = openfile->current_x; size_t was_current_x = openfile->current_x;
ssize_t current_y_save = openfile->current_y; ssize_t was_current_y = openfile->current_y;
bool edittop_inside = FALSE; bool edittop_inside = FALSE;
#ifndef NANO_TINY #ifndef NANO_TINY
bool right_side_up = FALSE, single_line = FALSE; bool right_side_up = FALSE, single_line = FALSE;
...@@ -1247,14 +1247,14 @@ void do_insertfile( ...@@ -1247,14 +1247,14 @@ void do_insertfile(
openfile->mark_begin_x += openfile->current_x; openfile->mark_begin_x += openfile->current_x;
} }
#endif #endif
openfile->current_x += current_x_save; openfile->current_x += was_current_x;
} }
#ifndef NANO_TINY #ifndef NANO_TINY
else if (openfile->mark_set) { else if (openfile->mark_set) {
if (!right_side_up) { if (!right_side_up) {
if (single_line) { if (single_line) {
openfile->mark_begin = openfile->current; openfile->mark_begin = openfile->current;
openfile->mark_begin_x -= current_x_save; openfile->mark_begin_x -= was_current_x;
} else } else
openfile->mark_begin_x -= openfile->current_x; openfile->mark_begin_x -= openfile->current_x;
} }
...@@ -1263,7 +1263,7 @@ void do_insertfile( ...@@ -1263,7 +1263,7 @@ void do_insertfile(
/* Update the current y-coordinate to account for the /* Update the current y-coordinate to account for the
* number of lines inserted. */ * number of lines inserted. */
openfile->current_y += current_y_save; openfile->current_y += was_current_y;
/* Unpartition the filestruct so that it contains all /* Unpartition the filestruct so that it contains all
* the text again. Note that we've replaced the * the text again. Note that we've replaced the
...@@ -1283,7 +1283,7 @@ void do_insertfile( ...@@ -1283,7 +1283,7 @@ void do_insertfile(
/* Mark the file as modified if it changed. */ /* Mark the file as modified if it changed. */
if (openfile->current->lineno != was_current_lineno || if (openfile->current->lineno != was_current_lineno ||
openfile->current_x != current_x_save) openfile->current_x != was_current_x)
set_modified(); set_modified();
/* Update the screen. */ /* Update the screen. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment