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

Add new command and default keycombo for Begin/End Select in column mode #12833

Closed
alankilborn opened this issue Jan 21, 2023 · 26 comments
Closed
Assignees
Labels

Comments

@alankilborn
Copy link
Contributor

alankilborn commented Jan 21, 2023

Description of the Issue


PREAMBLE NOTE: If #12832 is adopted, this would be a nice addition as well. If 12832 is NOT adopted, this probably doesn't make sense to implement on its own.


Currently Notepad++ ships with one sample macro, Trim Trailing Space and Save. I'd like to suggest a second one be created and shipped with Notepad++ releases.

I'd call this macro "Begin/End Select in Column Mode" and I would suggest a default key assignment of Alt+Shift+b. The Alt+Shift part reminds the user of the column-mode nature of running the macro -- because the user is used to using Alt+Shift+arrows to make a keyboard column selection.

Here is the suggested macro content:

<Macro name="Begin/End Select in Column Mode" Ctrl="no" Alt="yes" Shift="yes" Key="66">
    <Action type="0" message="2429" wParam="0" lParam="0" sParam="" />
    <Action type="0" message="2428" wParam="0" lParam="0" sParam="" />
    <Action type="2" message="0" wParam="42020" lParam="0" sParam="" />
</Macro>

Here's how the suggested entry would appear on the Macro menu:

image


Here's a usage example, for clarity:

  1. Open Notepad++'s license.txt file.
  2. Move the caret to line 1, column 5.
  3. Invoke the (suggested) Shift+Alt+b keycombo (to begin-select).
  4. Move the caret to the last line of the file, column 20.
  5. Invoke the (suggested) Shift+Alt+b keycombo a second time (to end-select).
  6. Observe the (longish) column block selection is made:

image


NOTE: This issue has its basis in discussions in this Community thread: https://community.notepad-plus-plus.org/topic/20616


Debug Information

Feature request based on current content of Notepad++ 8.4.8.

@pryrt
Copy link
Contributor

pryrt commented Jan 21, 2023

If 12832 is NOT adopted, this probably doesn't make sense to implement on its own.

Personally, I'm more likely to use this one (which is why I have that macro). I think it would be good to have this one in the default macros for a fresh install, whether or not the default keystroke is added for 12832.

@donho donho self-assigned this Jan 22, 2023
@donho
Copy link
Member

donho commented Jan 22, 2023

That's a good feature.
My only concern is the shortcut - for users who have already Alt-Shift-B defined, there will be the conflict.

@alankilborn
Copy link
Contributor Author

That's a good feature.
My only concern is the shortcut - for users who have already Alt-Shift-B defined, there will be the conflict.

It's true, but I think for the "greater good of the software" going forward...that it should be done.
Thank you for liking my suggestion.

@donho
Copy link
Member

donho commented Jan 22, 2023

@alankilborn

PREAMBLE NOTE: If #12832 is adopted, this would be a nice addition as well. If 12832 is NOT adopted, this probably doesn't make sense to implement on its own.

I don't think this FR depends on #12832. As I mentioned, my concern is added new shortcuts will have conflicts with users' defined - and users who use Begin/End Select command have added their own defined shortcut certainly. So #12832 won't be accepted.
However, it's interesting the macro of Begin/End Select in column mode.

@alankilborn
Copy link
Contributor Author

alankilborn commented Jan 22, 2023

users who use Begin/End Select command have added their own defined shortcut certainly. So 12832 won't be accepted.

It certainly would be nice to just say "the standard shortcut for Begin/End Select is ____".
Users wouldn't be overly annoyed that Notepad++ took over one of their custom assignments with the goal of standardization going forward; they'd just reassign it back to what they like and move on. Or even better, they'd say, "this is what Notepad++ says it should be...well, OK then".

@alankilborn
Copy link
Contributor Author

Assigning new default keycombos is not without recent precedent.
It wasn't too long ago that Mark was assigned to Ctrl+m, I see.

@donho
Copy link
Member

donho commented Jan 22, 2023

It wasn't too long ago that Mark was assigned to Ctrl+m, I see.

Is there any complain for it?

@alankilborn
Copy link
Contributor Author

Is there any complain for it?

I don't recall a single complaint.
@pryrt , do you remember any complaint?

@pryrt
Copy link
Contributor

pryrt commented Jan 23, 2023

Not that I recall. And a quick search doesn't reveal any.

@donho donho added the accepted label Jan 23, 2023
@donho
Copy link
Member

donho commented Jan 23, 2023

OK.
Could you guys create a PR for both #12832 & #12833 ?

@alankilborn
Copy link
Contributor Author

I had a late thought:

It is "cool" that the column version could be a macro, and we can move forward with that, but should it be considered to instead be a "real command", e.g., on the Edit menu there would be the existing Begin/End Select and then right below it "Begin/End Select in Column Mode" ??

@donho
Copy link
Member

donho commented Jan 23, 2023

@alankilborn
Why not?
There is "Column Mode" command in Edit menu which displays the instruction (how to). We might regroup/organization/restructure all these elements in order to provide a complete solution?

@alankilborn
Copy link
Contributor Author

alankilborn commented Jan 23, 2023

So it could appear on the Edit menu as:

...
----------------------
Column Mode...
Column Editor...                       Alt+C
Begin/End Select in Column Mode        Alt+Shift+B
----------------------
...

@pryrt
Copy link
Contributor

pryrt commented Jan 23, 2023

Based on the way Don described it, I interpret that as either 1 or 2 below:
image

Based on the way Alan originally described this, I was imagining it as 3:
image

Personally, I would prefer it as 3, because it falls more naturally for me with Select All and Begin/End Select.

But between 1 and 2, I would prefer 1 -- we already got users complaining about commands moving into sub-menus, so unless we absolutely have to, I wouldn't want a new sub-menu like 2

@donho
Copy link
Member

donho commented Jan 23, 2023

@pryrt @alankilborn
Thank you for your thought.
Let's take Solution 3 which is also the original proposal of @alankilborn.

And Column Mode Tip dialog message will be change from:

Please use "ALT+Mouse Selection" or "Alt+Shift+Arrow key" to switch to column mode.

to
There are 3 ways to switch to column mode:
1. Keyboard + Mouse: "ALT+Mouse Selection"
2. Keyboard: "Alt+Shift+Arrow key"
3. Command + caret position (via Mouse or Keyboard): 1st caret position + "Begin/End Select Column Mode (Alt+ShitShift+B)" + 2nd caret position + "Begin/End Select Column Mode (Alt+ShitShift+B)"

Any suggestion for a better Column Mode Tip dialog message ?

@alankilborn
Copy link
Contributor Author

Any suggestion for a better Column Mode Tip dialog message ?

I don't think we should say "shit" to the user in your number 3.
Number 2 would be a better place to say that (total joke, hopefully you understand that one).
(we want to say Shift, not Shit)

OK, I can tweak the message.
I'll see what I can do about submitting something to make these changes.
But as I am not set up for submitting PRs, it will take me a bit of time.
I see that translation files are currently being submitted for an 8.4.9 release.
Certainly don't hold up 8.4.9 waiting for me with this really minor feature.

@donho
Copy link
Member

donho commented Jan 23, 2023

I don't think we should say "shit" to the user in your number 3.
Number 2 would be a better place to say that (total joke, hopefully you understand that one).
(we want to say Shift, not Shit)

:D
The 2nd one is convenient too, it depends on users' habit.

I see that translation files are currently being submitted for an 8.4.9 release.
Certainly don't hold up 8.4.9 waiting for me with this really minor feature.

v8.4.9 is already on its way, so this feature will be in the next next version (v8.5) for sure.

I'll see what I can do about submitting something to make these changes.
But as I am not set up for submitting PRs, it will take me a bit of time.

I can do it if there are too many tasks for you.
Just let me know.

@alankilborn
Copy link
Contributor Author

I can do it if there are too many tasks for you.

I'll try it...should be fairly simple.
We have some time before 8.5.

@alankilborn
Copy link
Contributor Author

@donho, Probably easiest to combine #12832 and #12833 into a single PR -- acceptable?

@donho
Copy link
Member

donho commented Jan 23, 2023

@donho, Probably easiest to combine #12832 and #12833 into a single PR -- acceptable?

Sure - it makes sense to me.

@alankilborn alankilborn changed the title Add new example macro for Begin/End Select in column mode Add new command and default keycombo for Begin/End Select in column mode Jan 24, 2023
@alankilborn
Copy link
Contributor Author

@donho, After some review of "reality" :-) I wanted to change the spec on this, and of course want your approval before proceeding with it.

I think we are best served by this slight change to the proposed menu from Peter's "3" above:

* Begin/End Select            Ctrl+Shift+B
* End Select in Column Mode   Alt+Shift+B

"Begin" of the selection doesn't need to know the user-desired type (stream or column).

So the suggestion is that user uses Begin/End Select to start a selection, always. When user wants to end a stream selection, they again use Begin/End Select (no change from existing behavior). When user wants to end selection and have a column block appear, they use End Select in Column Mode.

There would be no change to the existing menu checkmark behavior for Begin/End Select.

There would be no menu checkmark at all for End Select in Column Mode as it is not needed.

However, End Select in Column Mode would be disabled/greyed if no "begin" is in effect.
Thus, these situations would always be true:

  • if Begin/End Select has no menu checkmark, then End Select in Column Mode is disabled/greyed
  • if Begin/End Select has the menu checkmarked, then End Select in Column Mode is enabled

What do you think?

@donho
Copy link
Member

donho commented Jan 29, 2023

@alankilborn
Your new proposal is logic and understandable from the devs' view (or from the view of ppl who do know well about Scintilla component).
However a newbie of Notepad++ would be confused by "Begin/End Select" + "End Select in Column Mode" & "Begin/End Select" + "Begin/End Select" combinations for 2 modes of selection.
Furthermore, using shortcuts "Ctrl+Shift+B" + "Alt+Shift+B" needs more effort to not invert the combination and to memorize. I would say it makes more sense "Alt+Shift+B" + "Alt+Shift+B" if user wants to do a column selection.
If users find out it's possible to do "Ctrl+Shift+B" + "Alt+Shift+B", it's good to them - they will have more option for column selection. But at least, for the dumb users like me, I am happy to keep using "Alt+Shift+B" + "Alt+Shift+B" for its non-ambiguity and simplicity.

For the sake of simplicity and less confusion, I prefer the separation of the 2 sets of commands for the 2 modes of selection.

@alankilborn
Copy link
Contributor Author

alankilborn commented Jan 30, 2023

@donho

OK, I will proceed based upon that feedback.


However,

If users find out it's possible to do "Ctrl+Shift+B" + "Alt+Shift+B", it's good to them - they will have more option for column selection.

I don't think this works.

If a user has activated Ctrl+Shift+B to create a begin-of-stream-select-position, and then sometime later presses Alt+Shift+B, wouldn't that cancel the (already in-progress) begin-of-stream and create a begin-of-column-select-position?

Or, maybe, if one type of the command is in-progress, the other type isn't available until the second part of the first has completed. Thus, after the first part, we'd have:

Begin/End Select
Begin/End Select in Column Mode

or:

Begin/End Select
Begin/End Select in Column Mode

NOTE: strike-through represents a disabled/greyed menu item.

I'm trying to think of novice user expectation here, but maybe I'm failing because I am not a novice user.

@pryrt
Copy link
Contributor

pryrt commented Jan 30, 2023

I think greying out the opposite mode until the selection is Ended is probably the most user-intuitive way of handling it. That way, it's abundantly clear to the user that they have to End in the same mode they Began.

@alankilborn
Copy link
Contributor Author

  1. Command + caret position (via Mouse or Keyboard): 1st caret position + "Begin/End Select Column Mode (Alt+Shift+B)" + 2nd caret position + "Begin/End Select Column Mode (Alt+Shift+B)"

The keycombos should NOT be embedded into this text (the "Column mode tip text") because these are just default/suggested keycombos, and can be changed by the user.

I will remove them from the text, and adjust the (entire) tip text a bit as well (to make it even better).

@donho
Copy link
Member

donho commented Feb 1, 2023

@alankilborn

The keycombos should NOT be embedded into this text (the "Column mode tip text") because these are just default/suggested keycombos, and can be changed by the user.

Hmm... you're right about it. Let's remove the shortcuts from the tip then.

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

Successfully merging a pull request may close this issue.

3 participants