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

[feature request] Page movement #21

Open
folofjc opened this issue Feb 28, 2022 · 3 comments
Open

[feature request] Page movement #21

folofjc opened this issue Feb 28, 2022 · 3 comments

Comments

@folofjc
Copy link

folofjc commented Feb 28, 2022

This is a great extension! One of the things I am missing (which would be very helpful with long lists) is some of the cursor movements:

  • H: move cursor to item at the top of the "page"
  • M: put the cursor in the middle of the "page"
  • L: Put cursor on item at the bottom of the "page"

In the above, the "page" is the things that you can currently see on the page. Not sure if that is feasible.

  • zz: Whatever item is under the current cursor position, scroll the page so that it is in the middle
  • zt: Whatever item is under the cursor, scroll the page so that it is at the top
  • zb: Whatever item is under the cursor, scroll the page so that it is at the bottom

Obviously, for these it depends on how much can be scrolled.

@Wojnach
Copy link
Owner

Wojnach commented Mar 2, 2022

yes, I've been missing zz too. All of them should be easy to implement. zt won't always work though due to how the workflowy page works. I'll have a look

@folofjc
Copy link
Author

folofjc commented Mar 2, 2022

Thanks!

For the zz one, even if there was a mapping to scroll the window without the arrow keys.

@awillats
Copy link

Hey all, just implemented zt, zz, zb in a local branch! Is there any interest in working on a merge request to get this into master?

It ended up being relatively straightforward but has a couple of hacks:
1.) I ended up throwing the keybinds in transparentKeybinding.js rather than keybindings.js. For some reason I couldn't get them to trigger in keybindings - maybe because they're a pair/sequence rather than a single key?
2.) Perhaps as a result of them being transparent, they would sometimes leak character inserts through, so I had to add a SimulateEscapeNormalMode to reset the normal mode state.

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

3 participants