commit a850bb25132d87c6d791eb6cd1269611167ba85b
parent 047cf9be9c029d560deba431a1889279349f870a
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 22 Aug 2017 11:51:02 -0500
moving: redraw not just the new current line but also the prior one
This fixes http://savannah.gnu.org/bugs/?51821.
Diffstat:
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/move.c b/src/move.c
@@ -463,6 +463,7 @@ void do_end(void)
* also scroll the screen one row, so the cursor stays in the same spot. */
void do_up(bool scroll_only)
{
+ filestruct *was_current = openfile->current;
size_t leftedge, target_column;
/* When just scrolling and the top of the file is onscreen, get out. */
@@ -482,7 +483,7 @@ void do_up(bool scroll_only)
if (scroll_only)
edit_scroll(UPWARD, 1);
- edit_redraw(openfile->current, FLOWING);
+ edit_redraw(was_current, FLOWING);
/* <Up> should not change placewewant, so restore it. */
openfile->placewewant = leftedge + target_column;
@@ -492,6 +493,7 @@ void do_up(bool scroll_only)
* scroll the screen one row, so the cursor stays in the same spot. */
void do_down(bool scroll_only)
{
+ filestruct *was_current = openfile->current;
size_t leftedge, target_column;
get_edge_and_target(&leftedge, &target_column);
@@ -506,7 +508,7 @@ void do_down(bool scroll_only)
if (scroll_only)
edit_scroll(DOWNWARD, 1);
- edit_redraw(openfile->current, FLOWING);
+ edit_redraw(was_current, FLOWING);
/* <Down> should not change placewewant, so restore it. */
openfile->placewewant = leftedge + target_column;
@@ -541,33 +543,31 @@ void do_scroll_down(void)
/* Move left one character. */
void do_left(void)
{
+ filestruct *was_current = openfile->current;
+
if (openfile->current_x > 0)
openfile->current_x = move_mbleft(openfile->current->data,
openfile->current_x);
else if (openfile->current != openfile->fileage) {
openfile->current = openfile->current->prev;
openfile->current_x = strlen(openfile->current->data);
-
- edit_redraw(openfile->current->next, FLOWING);
- return;
}
- edit_redraw(openfile->current, FLOWING);
+ edit_redraw(was_current, FLOWING);
}
/* Move right one character. */
void do_right(void)
{
+ filestruct *was_current = openfile->current;
+
if (openfile->current->data[openfile->current_x] != '\0')
openfile->current_x = move_mbright(openfile->current->data,
openfile->current_x);
else if (openfile->current != openfile->filebot) {
openfile->current = openfile->current->next;
openfile->current_x = 0;
-
- edit_redraw(openfile->current->prev, FLOWING);
- return;
}
- edit_redraw(openfile->current, FLOWING);
+ edit_redraw(was_current, FLOWING);
}