Also, the value of `magit-section' is different all three times, if that's important.

Paul

On Sat, 27 Aug 2022 at 18:32, Paul Pogonyshev <pogonyshev@gmail.com> wrote:
> Now, I put the point at the beginning of the third line ([^] is the point):

Text content at position 32867:

There is an overlay here:
 From 32867 to 32901
  evaporate            t
  font-lock-face       magit-diff-file-heading-highlight

There are text properties here:
  font-lock-face       magit-diff-file-heading
  keymap               [Show]
  magit-section        [Show]

> I press C-b, expecting that the point is moved to the end of the
> previous line that I see. But it is not moved there

Text content at position 29881:

There is an overlay here:
 From 29881 to 32867
  evaporate            t
  invisible            t

There are text properties here:
  font-lock-face       magit-diff-hunk-heading
  keymap               [Show]
  magit-section        [Show]

> If I press C-b again, only now point is moved

Text content at position 29880:

There is an overlay here:
 From 29858 to 29881
  evaporate            t
  font-lock-face       magit-diff-file-heading-highlight

There are text properties here:
  keymap               [Show]
  magit-section        [Show]

Paul

On Sat, 27 Aug 2022 at 18:28, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Paul Pogonyshev <pogonyshev@gmail.com>
> Date: Sat, 27 Aug 2022 18:12:49 +0200
> Cc: Gerd Möllmann <gerd.moellmann@gmail.com>,
>       57433-done@debbugs.gnu.org
>
> Actually, disregard that. It appears to be a Magit bug. If I switch the buffer
> to any other mode, everything behaves as expected.

Right.  I suspect that Magit puts something else there, not just the
invisible property.  What does describe-text-properties say at that
point?