when indenting lines, properly keep track of the mark coordinates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3449 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
8bf39a38fe
commit
4527da5e9b
16
src/text.c
16
src/text.c
|
@ -278,10 +278,12 @@ void do_indent_marked(ssize_t len)
|
||||||
null_at(&f->data, line_len - indent_len + 1);
|
null_at(&f->data, line_len - indent_len + 1);
|
||||||
openfile->totsize -= indent_len;
|
openfile->totsize -= indent_len;
|
||||||
|
|
||||||
/* If this is the current line, adjust the x-coordinate
|
/* If this is the current line, keep track of the change
|
||||||
* to compensate for the change in it. */
|
* in it. */
|
||||||
if (f == openfile->current)
|
if (f == openfile->current) {
|
||||||
openfile->current_x -= indent_len;
|
openfile->current_x -= indent_len;
|
||||||
|
openfile->mark_begin_x -= indent_len;
|
||||||
|
}
|
||||||
|
|
||||||
/* We've unindented, so set indent_changed to TRUE. */
|
/* We've unindented, so set indent_changed to TRUE. */
|
||||||
if (!indent_changed)
|
if (!indent_changed)
|
||||||
|
@ -296,10 +298,12 @@ void do_indent_marked(ssize_t len)
|
||||||
strncpy(f->data, line_indent, line_indent_len);
|
strncpy(f->data, line_indent, line_indent_len);
|
||||||
openfile->totsize += line_indent_len;
|
openfile->totsize += line_indent_len;
|
||||||
|
|
||||||
/* If this is the current line, adjust the x-coordinate to
|
/* If this is the current line, keep track of the change in
|
||||||
* compensate for the change in it. */
|
* it. */
|
||||||
if (f == openfile->current)
|
if (f == openfile->current) {
|
||||||
openfile->current_x += line_indent_len;
|
openfile->current_x += line_indent_len;
|
||||||
|
openfile->mark_begin_x += line_indent_len;
|
||||||
|
}
|
||||||
|
|
||||||
/* If the NO_NEWLINES flag isn't set, and this is the
|
/* If the NO_NEWLINES flag isn't set, and this is the
|
||||||
* magicline, add a new magicline. */
|
* magicline, add a new magicline. */
|
||||||
|
|
Loading…
Reference in New Issue