Keyboard shortcut to jump to top/bottom of guide


From http://indentguide.codeplex.com/discussions/353546

Probably have to be based on the currently highlighted guide, though this would limit caret handlers to only one highlight (maybe use a new handler for this?)

Shift+Alt+PgUp/Dn looks like it is free, though it may be used by other extensions.

file attachments


erapopor wrote Oct 23, 2012 at 4:54 PM

I was able to implement this feature. I added two commands, “Move to Top of Span” and “Move to Bottom of Span”, to the Edit->Advanced menu. see changed files and documentation in attached zip file
Let me know how to proceed.

Ed Rapoport

Zooba wrote Oct 25, 2012 at 1:37 AM

Wow, that's great work. However, my one concern with this still stands, since I'm keen to support multiple highlighted guides and it is unclear how this will work with handlers like that. I think I can come up with some reasonable ways to make that work, but this may be a better candidate for an independent extension that performs some basic code analysis (for example, "find previous '{'" or "find previous "Sub/If/etc." commands). I think the behaviour of those will be more predictable than following the guides.

In terms of "how to proceed," I take it that by attaching the code here you're allowing me to merge some or all of it into the main codebase, so nothing needs doing there. Because of time constraints I'm unlikely to be making another release any time soon, so you are welcome to distribute your version and I'm happy to link to you from my main CodePlex page. All I'd ask is that you change the information in source.extension.vsixmanifest so users find your page rather than mine (URL and name - if you leave the identity the same then people won't be able to install both at the same time, which is probably a good thing).

erapopor wrote Jan 17, 2013 at 9:31 PM

I finally had a chance to get back to this. I fixed the IndentGuide.vsct file so that the icons I designed show up in the Edit->Advanced menu and added keyboard short cuts (ctrl-alt-shift Page Up and Page Down).
I wanted to do that before I established a new codeplex project.

I saw in the meantime that you fixed a defect in December. I would like to redo my changes on your new tip code.
I established a fork on IndentGuides in codeplex (username erapopor) and sent a pull request to get the current code on the that fork. I hope that you will agree to that.
Otherwise I could copy your current code, but I hate copying code without the source code history.

Thanks for your continued work and Happy New Year.

Ed Rapoport

Zooba wrote Jan 18, 2013 at 12:35 AM

You don't need to do a pull request for this, but it is a little fiddly: you need to pull the changes from the main repository into yours, merge the two heads that will be on your local machine, then push the changes into your fork. Of course, my recent changes may not be reliable, so take them at your own risk. The last beta release seems to be okay, so that may be a safer point to apply your changes.

A pull request is asking me to copy your changes into the main repository, which is basically the same process except that I'm the one who does it. The terminology isn't great, but it's what Mercurial gives us.

Something else you may want to consider is simply taking the document analysis part of Indent Guides and not replicating the rest of its functionality. This would mean your extension is smaller and easier to maintain, and will work even if the guides are hidden (or not even installed).