Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird thing happening with the point when threads are collapsed #27

Open
mcamou opened this issue Sep 23, 2021 · 8 comments
Open

Weird thing happening with the point when threads are collapsed #27

mcamou opened this issue Sep 23, 2021 · 8 comments

Comments

@mcamou
Copy link

mcamou commented Sep 23, 2021

If I have the point at the message just below a collapsed thread and I do an action (say press d for Delete) the action applies to one of the messages inside the fold instead of the one where the point is at. It could be related to #7

@rougier
Copy link
Owner

rougier commented Sep 26, 2021

The reason might be that the cursor is not moved after folding and still relate to the message before collapsing. Not moving the cursor is useful when you fold/unfold (your cursor does not move) but in your case it is annoying. Nott sure what would be the best behavior.

@mcamou
Copy link
Author

mcamou commented Sep 27, 2021

However, this does not just happen after folding. My buffer has all messages folded. I move the cursor to the message below the fold, and when I hit Enter the last message within the fold is displayed. You can also see it in the message list: the underline that shows the current message disappears (I assume that it is somewhere within the fold).

Regarding what you mentioned about the best behavior, in my case at least I think that having the cursor move when you fold/unfold is a lot less annoying than having the wrong message be current. At least if the cursor moves the visual feedback actually matches what is happening behind the scenes.

If you don't want the cursor to move, when you fold you could change the current message to be the first message within the fold. That would fix both problems: the visual feedback matches what is displayed, and you still don't move the cursor. However, it might be a bit jarring/inconvenient if you are viewing a different message within the fold at that point.

@mcamou
Copy link
Author

mcamou commented Sep 27, 2021

This is what I mean:

  • I am in the headers view, with no message opened. All threads are folded.
  • The cursor is on a message right above a folded conversation
  • I press J. The current message indicator (the underline) is the fold.
  • I press J. The current message indicator disappears.
  • I press J. The current message indicator appears on the message just below the fold.

If the fold contains an unread message, the message indicator disappears after trying moving to the message AFTER the unread message (not when moving to the unread message itself).

@mcamou
Copy link
Author

mcamou commented Sep 27, 2021

The case with the fold containing an unread message can be even weirder. I just saw this happen:

  • The cursor is on the fold. There is an unread message from the fold right below the fold.
  • I press J. The current message indicator disappears.
  • I press J. The current message indicator appears on the message BELOW the unread message (i.e. there is no way to select the unread message short of unfolding)

@rougier
Copy link
Owner

rougier commented Sep 27, 2021

Do you get the same behavior if you use (n)ext (p)revious keys?

@mcamou
Copy link
Author

mcamou commented Sep 27, 2021

I'm using Doom Emacs (therefore evil-mode), so J above is actually mu4e-headers-next (and I should actually have said j instead of J). The down arrow actually works correctly.

In the case of a single fold (whether the message below the fold is an unread message on the same thread, or is an unrelated message):

  • C-j on a fold moves the cursor to the message after the fold and the underline disappears.
  • The next C-j moves the cursor RIGHT one space, the underline is appears on the message after the fold (where the cursor is).
  • The next C-j moves the cursor to the next message, the underline reappears.

In the case of a two consecutive folds the same thing happens, except that the cursor does not move right when pressing C-j on the second fold.

@mcamou
Copy link
Author

mcamou commented Sep 27, 2021

Correction: the down arrow does the same thing as j / C-j.

@rougier
Copy link
Owner

rougier commented Oct 4, 2021

By the way, I experienced an alternative thread folding which is simpler and faster: https://gist.github.com/rougier/98e83fb50e19fb73fe34a7ecc5fc1ccc

I think the behavior is more consistent but I'm not sure if it can be adapter to mu4e-thread-folding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants