Skip to content

Add progressive increment across multiple cursors to the tutor #10821

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

brunbjerg
Copy link

Added a section on how to do PROGRESSIVE INCREMENT AND DECREMENT.

@hakan-demirli
Copy link

related: #9040

@the-mikedavis the-mikedavis linked an issue Jun 3, 2024 that may be closed by this pull request
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

We should keep the notation that we use for key combinations consistent: in other places in the tutor like section 7.4 we use Ctrl-a rather than c-a as you have here.

In the long run I'd like to have the tutor explain and use the key sequence notation that we use for keybindings and macros (best documented only by the code currently in helix-view/src/input.rs I believe).

For now though let's be verbose and say things like 'press " and then # followed by Ctrl-a'.

@the-mikedavis the-mikedavis added the A-documentation Area: Documentation improvements label Jun 3, 2024
@mattkang
Copy link

Hey I'm happy to implement the requested changes if you don't have time @brunbjerg. I was actually stumped by this myself, and I agree that the proposed clarifications are required. I completely misparsed the "# sequence.

runtime/tutor Outdated
@@ -834,6 +834,28 @@ lines.



=================================================================
= 7.5 PROGRESSIVE INCREMENTING AND DECREMENTING =
Copy link
Contributor

@david-crespo david-crespo Jul 22, 2024

Choose a reason for hiding this comment

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

What does "progressive" mean here? I don't see it used in the keymap doc or the source. If it's redundant with the concept of incrementing, I find that confusing and it would be better to remove it. Luckily everything works fine grammatically if you just remove it from all three spots.

Edit: And of course, if it does mean something, it would be nice to add a sentence explaining that.

Edit 2: Ok, I saw this and finally got it. Like @mattkang, I misunderstood the "#, so I wasn't able to get it to do the progressive thing. I stand by the point that the word "progressive" isn't sufficient to guess what the outcome of the key sequences is supposed to be.

Copy link
Author

@brunbjerg brunbjerg Jul 22, 2024

Choose a reason for hiding this comment

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

https://marketplace.visualstudio.com/items?itemName=narsenico.vscode-progressive-increment#review-details

I took got the progressive part from this VSCode extension. I thought that it was standard terminology.

Edit: What do you think that it should be changed to instead?

@brunbjerg brunbjerg force-pushed the add-progressive-increment-across-multiple-cursors-to-the-tutor branch from c389b57 to a905ef6 Compare July 22, 2024 16:59
@brunbjerg
Copy link
Author

Hey I'm happy to implement the requested changes if you don't have time @brunbjerg. I was actually stumped by this myself, and I agree that the proposed clarifications are required. I completely misparsed the "# sequence.

Thank you writing and reminding, I have made a new iteration of the PR. You are also welcome to changes to the branch :)

runtime/tutor Outdated
@@ -834,6 +834,28 @@ lines.



=================================================================
= 7.5 PROGRESSIVE INCREMENTING AND DECREMENTING =
Copy link
Member

Choose a reason for hiding this comment

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

This might fit better in chapter 8. 8.1 introduces registers and how to select them. After that we could have a section that shows selecting the # register and pasting (pastes the selection indices) and then incrementing and decrementing

Copy link
Author

@brunbjerg brunbjerg Aug 14, 2024

Choose a reason for hiding this comment

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

Something like this?

Also, would it make sense to expand the tutor for the remaining registers?

Like the '".' and '"%'?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, what I'm thinking is that we introduce special registers first and then have a quick chapter on the basic use of the # special register (just showing what happens when you use it to paste), and then the chapter after that can show increment/decrement

=================================================================
=                     8.2 SPECIAL REGISTERS                     =
=================================================================

 A few reserved registers don't behave like normal registers and
 have special effects:

 +  Read and write to the system clipboard
 *  Read and write to the primary clipboard
 _  Discards all writes and reads nothing
 %  Reads the name of the current buffer
 .  Reads the current selections
 #  Reads the selection indices

 Other than + and * these registers can't be written to.







=================================================================
=              8.3 SELECTION INDEX SPECIAL REGISTER             =
=================================================================

 The selection index special register can be used to insert
 incrementing numbers under each selection.

 1. Move the cursor to the first line marked '-->' below. Place
    the cursor past the '-->'
 2. Type C four times or 4C.
 3. Type " and then # to select the # special register.
 4. Use p to paste.

 --> 00000
 --> 00000
 --> 00000
 --> 00000





Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Documentation improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add explanation in the docs for multiple selection increment
5 participants