Commit 5bc4abee authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

text: update placewewant properly when indenting/unindenting

If the position of the cursor changes horizontally,
placewewant should change with it.

This fixes https://savannah.gnu.org/bugs/?51407

.
Reported-by: default avatarDavid Lawrence Ramsey <pooka109@gmail.com>
parent ac726f08
Showing with 4 additions and 1 deletion
+4 -1
......@@ -363,8 +363,10 @@ void do_indent(ssize_t cols)
openfile->mark_begin_x >= indent_len)
openfile->mark_begin_x += line_indent_len;
if (f == openfile->current && openfile->current_x >= indent_len)
if (f == openfile->current && openfile->current_x >= indent_len) {
openfile->current_x += line_indent_len;
openfile->placewewant = xplustabs();
}
/* If the NO_NEWLINES flag isn't set, and this is the
* magicline, add a new magicline. */
......@@ -405,6 +407,7 @@ void do_indent(ssize_t cols)
openfile->current_x = indent_new;
else
openfile->current_x -= indent_shift;
openfile->placewewant = xplustabs();
}
/* We've unindented, so the indentation changed. */
......
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