emacs-devel
[Top][All Lists]
Advanced

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

Re: master f450798: Don't move point in vc-dir on vc-register/vc-checkin


From: Andrii Kolomoiets
Subject: Re: master f450798: Don't move point in vc-dir on vc-register/vc-checkin (bug#43188)
Date: Tue, 15 Sep 2020 22:14:12 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Wow!  That seems more complex than we'd like it to be.
> Hmm...
>
> Maybe doing it inside ewoc--refresh-node makes it easier, as in the
> 100% untested patch below.

The complexity came from attempt to save the line and column offset
within node.  That code is not needed considering that there are not so
many multiline ewoc nodes.

The reason the save-point code was added to 'ewoc-invalidate' is to
avoid point movements on refreshing each node and make one movement once
all the nodes are refreshed.  As I can see 'ewoc-invalidate' is used to
refresh single node, so placing that code inside 'ewoc--refresh-node' is
more appropriate.

Your code works great except:

> +      (goto-char (+ m (* percent (- end m)))))))
                         ^ this must be wrapped with (round)

Also I would move point by offset rather than percent to save exactly
the same position.

Imagine the line in vc-dir (with point under |):

    edited   |foo.txt

After invalidation some text is added after filename, e.g.:

    edited   |foo.txt  (resolved conflict or something)

Isn't it better to leave point where it was and not move it to the right
because line length is increased?



reply via email to

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