]> git.eshelyaron.com Git - emacs.git/commit
Don't completely clip into visible range in treesit_record_change
authorYuan Fu <casouri@gmail.com>
Fri, 17 Feb 2023 22:21:49 +0000 (14:21 -0800)
committerYuan Fu <casouri@gmail.com>
Fri, 17 Feb 2023 22:27:23 +0000 (14:27 -0800)
commit0a5615669a4f5d7e2db3c4117f3c2440e9c4cfd5
tree97ed6e6fa97f76b894a886b3bd896d66d2b5bf43
parent5b34fc07085a4ec636124756d09dcc3be8414eb8
Don't completely clip into visible range in treesit_record_change

(Bug#61369)

From
    min (visible_end, max (visible_beg, new_end_byte)) - visible_beg
to
    max (visible_beg, new_end_byte) - visible_beg

* src/treesit.c (treesit_record_change): We don't clip the new end
into the visible range anymore.  If you think of it, when inserting in
a narrowed region, the visible region is always extended to
accommodate more text, rather than pushing text at the end to keep the
size of the visible region.
src/treesit.c