unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Romain Ouabdelkader <romain.ouabdelkader@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: sbaugh@janestreet.com, Eli Zaretskii <eliz@gnu.org>,
	73863@debbugs.gnu.org
Subject: bug#73863: 30.0.91; Unexpected cursor movement with flymake-show-diagnostics-at-end-of-line
Date: Sun, 20 Oct 2024 17:01:44 +0200	[thread overview]
Message-ID: <CAJ8YToY2YBSsMzc6oc3fCcwUNNHCDT3CY7ifHfFFPF2yhSBJJg@mail.gmail.com> (raw)
In-Reply-To: <CALDnm50Smp4P=q+XNN3eayy=Q-+8v=OZtbhCxQVaa_C=uJH3Sg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2534 bytes --]

Sorry, I realized I wasn't clear about the behavior I was expecting.

I would expect the cursor behavior to remain consistent whether diagnostics
are present or not, especially since diagnostics can appear and disappear
during editing.

For example:
[image: Screenshot 2024-10-20 at 16.56.48.png]
Here, when press C-n once, I expect the cursor to go here:
[image: Screenshot 2024-10-20 at 16.57.59.png]

I.e. the behavior would be the same as if there were no diagnostics in the
buffer.
I'm not sure if that's actually feasible or if there is an issue with this
behavior.

I tried your patch but it makes the cursor go on the diagnostic which i
find surprising, I believe the cursor should not be able to move into a
diagnostic:
[image: Screenshot 2024-10-20 at 17.00.18.png]

What do you think?

On Sun, Oct 20, 2024 at 4:42 PM João Távora <joaotavora@gmail.com> wrote:

> On Sun, Oct 20, 2024 at 12:49 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > That would mean a non-trivial code in flymake.el, because it would
> > need to decide in advance whether the diagnostic will fit on the same
> > screen line.  Moreover, if the user then makes the window wider or
> > narrower, the cursor will jump between two screen positions, something
> > that I think is highly undesirable (and will look like a bug).
>
> Yes, you're right, but the solution you propose is arguably harmful for
> the current case.  If I'm at line n, column c and I move down to line n+1
> with
> less than c columns, and that line n+1 has a wrapping diagnostic at eol, I
> now
> see that a single 'down' makes the cursor jump multiple screen lines
> to the end
> of said diagnostic, and that's not really pretty either.  And even
> closer to this
> report's scenario, your solution only makes some sense if the overlays
> happen
> to only wrap one line: it ceases to make sense in very narrow windows
> where the overlays wrap multiple lines.
>
> IMO, wrapping these annotations is more distracting than useful.
> They're meant to be minimally intrusive auxiliary visual aids, and causing
> screen line increase violates that.  Note that the full diagnostic info
> can be
> viewed via eldoc in the echo area for example, where there are options to
> control length and jumping (and where window width isn't an issue).
>
> So I advise to turn on line truncation when using them, or to live with the
> current idiosyncrasy instead of another equivalent (IMO slightly worse)
> idiosyncrasy.
>
> João
>

[-- Attachment #1.2: Type: text/html, Size: 3187 bytes --]

[-- Attachment #2: Screenshot 2024-10-20 at 16.56.48.png --]
[-- Type: image/png, Size: 40336 bytes --]

[-- Attachment #3: Screenshot 2024-10-20 at 16.57.59.png --]
[-- Type: image/png, Size: 39434 bytes --]

[-- Attachment #4: Screenshot 2024-10-20 at 17.00.18.png --]
[-- Type: image/png, Size: 36838 bytes --]

  reply	other threads:[~2024-10-20 15:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 15:09 bug#73863: 30.0.91; Unexpected cursor movement with flymake-show-diagnostics-at-end-of-line Romain Ouabdelkader
2024-10-18 16:08 ` Eli Zaretskii
2024-10-18 16:24   ` Romain Ouabdelkader
2024-10-18 18:31     ` Eli Zaretskii
2024-10-18 19:10       ` Romain Ouabdelkader
2024-10-19 13:15         ` Eli Zaretskii
2024-10-19 13:41           ` Romain Ouabdelkader
2024-10-20  7:25             ` Eli Zaretskii
2024-10-20  9:28               ` João Távora
2024-10-20 11:22                 ` Eli Zaretskii
2024-10-20 11:38                   ` João Távora
2024-10-20 11:49                     ` Eli Zaretskii
2024-10-20 14:42                       ` João Távora
2024-10-20 15:01                         ` Romain Ouabdelkader [this message]
2024-10-20 15:49                           ` Eli Zaretskii
2024-10-20 16:23                             ` Eli Zaretskii
2024-10-20 15:31                         ` Eli Zaretskii
2024-10-20 15:39                           ` João Távora
2024-10-20 16:30                             ` Eli Zaretskii
2024-10-20 16:58                               ` João Távora
2024-10-20 17:50                                 ` Eli Zaretskii
2024-10-20 18:05                                   ` João Távora
2024-10-20 18:28                                     ` Eli Zaretskii
2024-10-20 19:18                                       ` João Távora
2024-10-18 19:16       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-18 19:25         ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ8YToY2YBSsMzc6oc3fCcwUNNHCDT3CY7ifHfFFPF2yhSBJJg@mail.gmail.com \
    --to=romain.ouabdelkader@gmail.com \
    --cc=73863@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).