bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43587: move-to-column behaves differently when text has invisible pr


From: Eli Zaretskii
Subject: bug#43587: move-to-column behaves differently when text has invisible property
Date: Tue, 29 Sep 2020 22:00:24 +0300

> From: Christoph Arenz <tiga.arenz@web.de>
> Date: Tue, 29 Sep 2020 17:56:45 +0200
> 
> (progn
>   (switch-to-buffer "indent-test.txt")
>   (erase-buffer)
>   (insert "\tLine starting with INVISIBLE text after TAB\n")
>   (insert "\tLine starting with visible text after TAB\n")
>   (insert "\nUsing move-to-column to move 'into' TAB, using the FORCE 
> parameter on both lines\n")
>   (whitespace-mode 1)
>   (add-text-properties 2 21 '(invisible t))
>   (beginning-of-buffer)
>   (move-to-column 7 t)
>   (forward-line)
>   (move-to-column 7 t))

It's a deficiency in the algorithm used by move-to-column that
determines whether the goal column is in the middle of a TAB.  It
assumes that in such a case the TAB is the previous character that
ends at the column where the movement ended, but that is not so when
invisible text immediately follows the TAB, because moving over the
TAB will in that case also skip all of the following invisible text.

I will see how this can be fixed without making the function too slow
(because it needs to consider overlays as well, not just text
properties).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]