Skip to content

Select multiple words/lines when double/triple clicking.#5127

Open
RobertP-McDowell wants to merge 3 commits into
MidnightCommander:masterfrom
RobertP-McDowell:master
Open

Select multiple words/lines when double/triple clicking.#5127
RobertP-McDowell wants to merge 3 commits into
MidnightCommander:masterfrom
RobertP-McDowell:master

Conversation

@RobertP-McDowell

@RobertP-McDowell RobertP-McDowell commented Jun 14, 2026

Copy link
Copy Markdown

Proposed changes

Quality of life feature for mouse users. Many text editors have the ability to drag select words and lines, and mcedit already allows you to select one word at a time, this is just an improvement of what's already there!

Also updated how the delay between clicks works to start the timer on mouse down instead of up, this is a lot more common in text editors (your very browser probably behaves this way); this change affects all other widgets that use double-click functionality.

  • Resolves: #... (No prior issue I could find)

Checklist

  • I have referenced the issue(s) resolved by this PR (if any)
  • I have signed-off my contribution with git commit --amend -s
  • Lint and unit tests pass locally with my changes (make indent && make check)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Tested with both gpm and xterm-only mouse support, ncurses, and slang.

@github-actions github-actions Bot added needs triage Needs triage by maintainers prio: medium Has the potential to affect progress labels Jun 14, 2026
@github-actions github-actions Bot added this to the Future Releases milestone Jun 14, 2026

@ossilator ossilator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the commit messages lack explanations/justifications of the changes.

also, judging by the commit message, the 2nd commit mixes two unrelated changes.

@RobertP-McDowell

RobertP-McDowell commented Jun 14, 2026

Copy link
Copy Markdown
Author

I made each commit message clearer, and I thought changing the click time delay was an important enough change to warrant a third commit after all, so I split up the 2nd commit into two.

Comment thread src/editor/edit.c Outdated
Comment thread src/editor/edit.c Outdated
Comment thread src/editor/edit.c
Comment thread src/editor/edit.c Outdated
Comment thread src/editor/editwidget.c Outdated
Comment thread src/editor/edit-impl.h Outdated
Comment thread src/editor/edit-impl.h Outdated
Comment thread src/editor/edit.c
Comment thread src/editor/edit.c Outdated
Comment thread src/editor/edit.c Outdated
Comment thread src/editor/edit.c Outdated
Comment thread src/editor/edit.c Outdated
@RobertP-McDowell

Copy link
Copy Markdown
Author

I changed the functionality a bit so double clicking will always select at least one character in my last force-push, and resolved the reviewed changes. Thanks.

Comment thread src/editor/edit.c Outdated
@mc-worker

Copy link
Copy Markdown
Contributor

Thanks! Double click to select a word and a triple click to select a line work fine. But the descriptions of the 2nd commit is unclear for me.

Highlight multiple lines when triple clicking in mcedit.

Like the last commit, improves triple clicking to allow the user to drag select multiple lines on double clicking in the editor.

Could you please describe how it should work?

This is an improvement to double clicking in the editor, allowing
the user to select multiple words by dragging the mouse. Previously,
the user could only select one word at a time by double clicking.

Signed-off-by: Robert P. McDowell <teatimewithrobert@gmail.com>
Improves triple clicking in the editor, allowing the user to select
multiple lines after a triple-click by dragging the mouse. Previously,
the user could only select one line at a time after triple clicking.

Signed-off-by: Robert P. McDowell <teatimewithrobert@gmail.com>
This is to compliment the last two commits. Before if the user
dragged their mouse and tried to immediately click, they might
unintentionally initiate a double click; after triple clicking was
re-implemented it was a noticabely bigger issue, with accidental
triple clicks. Fix it by starting the click timer on an earlier input.

Signed-off-by: Robert P. McDowell <teatimewithrobert@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs triage Needs triage by maintainers prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

3 participants