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

Editing mode fix and documentation scrolling #138

Merged
merged 3 commits into from
Aug 11, 2017

Conversation

joguSD
Copy link
Contributor

@joguSD joguSD commented Aug 8, 2016

Prompt toolkit deprecated setting the editing mode via the enable_vi_mode kwarg on key manager creation. The editing mode is now directly passed to the Application instantiation based on the bool instead.

Additionally, I've enabled mouse support to switch between the default and docs buffers on click and allowed for scrolling in the docs buffer. I've also added a keybinding on F9 to switch between the buffers. I'm not sure which key is best to toggle back and forth, perhaps there are some standards that vim/emacs have that we could bind this to instead.
Fix for #74

Note: Enabling mouse support in prompt_toolkit seems to have the side effect that the terminals built in text highlighting/selection no longer works. I verified this behavior by looking at pyvim which also does the same thing. While switching between the buffers with mouse clicks and scrolling the docs with the scroll wheel is very natural, losing text selection might not be the best customer experience.

@jamesls @JordonPhillips

@JordonPhillips
Copy link
Contributor

I'm 0 on enabling mouse mode. I don't know that mouse scrolling is really what we're looking for. On the other hand, the very limited subset of vim bindings doesn't seem to have the capability to page up and down, so there may be no other way.

I like the binding for switching windows (since changing buffers also appears to be unsupported), but I think it needs an entry on the help line.

@donnemartin
Copy link
Collaborator

donnemartin commented Nov 2, 2016

@jamesls
Copy link
Member

jamesls commented Aug 7, 2017

Seems fine, I like being able to click on the doc buffer to scroll (though I don't think I'd actually scroll with my mouse). Could you update the docs as well?

@joguSD
Copy link
Contributor Author

joguSD commented Aug 7, 2017

@jamesls Yeah, I can update the docs. It's also worth mentioning that clicking to switch buffers isn't required to scroll the buffer. Enabling mouse support and hovering over the buffer while scrolling will send the scroll events to that buffer even if it's not focused. Clicking to switch buffers, as well as the F9 hotkey enable the vim/emacs keybindings to be applied to the docs buffer.

@joguSD joguSD force-pushed the editing-mode-fix branch from 3a930b5 to 4db76ca Compare August 9, 2017 17:23
@joguSD joguSD force-pushed the editing-mode-fix branch from 4db76ca to 32f31d2 Compare August 9, 2017 17:30
@joguSD joguSD merged commit d597b79 into awslabs:master Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants