-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Basic caret and visual modes implementation #626
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
Conversation
Allow user switch in caret mode for browsing with caret, and visual mode for select and yank text with keyboard. Default keybindings is c or v for caret mode, and again v for visual mode. All basic movements provided by WebAction enum implemened with vim-like bindings. Yanking with y and Y for selection and clipboard respectively. There is bug/feature in WebKit that after caret enabled, caret doesn't show until mouse click (or sometimes Tab helps). So I add some workaround for that with mouse event. I think should be better aproach. Signed-off-by: Artur Shaik <ashaihullin@gmail.com>
|
Whoa, this is pretty damn cool! Thanks a lot! Some improvements (and ideas, if you feel like implementing them):
|
|
|
Some people (like @mgraham - and possibly me too when I use those modes) would like to use hjkl or other keys instead of the cursor keys for spatial navigaton/caret browsing. It seems QtWebKit doesn't give us a way to customize those bindings - but we could add a new hidden command |
Make mouseclick event point slightly down. Add commented tries of more reliable methods of caret focusing.
|
|
Thanks! I didn't notice you already did bind hjkl in that mode. I'll test it and see what I think about it 😄 For the caret issue I'll try to play a bit in the hope of finding something... Clicking at an essentially random location in the page definitely is something I don't want to do, as it could have unintended effects (like, dunno, buying something). |
😄The good thing is that, this mouse event doesn't trigger links to open. But of course needs to test it on all platforms. |
|
I don't think this will make it into v0.2 as I'll have to test it and try to find an alternative solution to make the caret appear. Is this okay for you? 😄 v0.3 will probably be a release without many new spectacular features from my side (as I'll be working on #499 and other config migrations, so that'd be a good time to add it. |
|
Yeah, that's ok. Thanks. On 04-13 (22:41), Florian Bruhin wrote:
Best regards, |
|
Sorry for the long delay! I've now looked at this a bit, resolved the conflicts and pushed to the visual branch. I still have some questions/ideas - if you do new commits, can you please do them on top of the visual branch and submit a new pull request agains that branch? First of all about the workaround: I'm still trying to find something suitable, but on the pages I tested (http://www.heise.de/ and http://www.cmpl.cc/) your workaround didn't help at all - and since it could maybe also do weird things, I'm afraid I'd really prefer no workaround to that 😢 I also wonder if it's really a good idea to have separate modes for caret/visual, as they are very similiar. I know right now it's like it's implemented in dwb, but I think something else would be better - I wonder what you think about this. I've never used the visual feature in dwb before, so in qutebrowser that's what I tried intuively and what didn't work (very similiar to the copy mode in screen/tmux):
How does that sound to you? |
|
Hi. That's strange, I've just tested, for me your links work nice. My usual usage of caret was: scroll page in normal mode to plain text (because browser is positioning caret at top of the window), click caret navigate to text for selection, than select it, yank. But even if I press caret key at default top position (with no scroll in normal mode) it gives me caret in menu of this sites, you gave me. I really see this workaround as some dog-nail, and I hope we will find nice approach to do it right, but without it, wee always must use mouse to position our caret at first time. This hurts me 😄 . May be QtWebkit team can do something? About modes. Separates modes I see more vim like, and why I did separate, because I got used it in dwb and cVim (Chrome). And this is nice indication about what you are doing right now. And adding additional mode more like configuration instead programming, thanks you for that 😃 . I think we need more opinions about it. My pros: vim-like, indication. |
|
I've now found a different workaround (calling Now the caret always gets shown correctly, but as you said, it starts at the top of the page. Is this acceptable for you? About the different modes: As we discussed in IRC, I think it'd be better to have one shared mode and just have an indication in the statusbar. Do you want to do this or should I? |
|
Yeah, I think I can do it. For now, I can accept focus at top of the page, will see how new workaround works. |
|
Closing this because #653 is open now. |
Allow user switch in caret mode for browsing with caret, and visual mode
for select and yank text with keyboard. #597
Default keybindings is c or v for caret mode, and again v for visual mode. All
basic movements provided by WebAction enum implemened with vim-like
bindings. Yanking with y and Y for selection and clipboard respectively.
There is bug/feature in WebKit that after caret enabled, caret doesn't
show until mouse click (or sometimes Tab helps). So I add some workaround
for that with mouse event. I think should be better aproach.
Signed-off-by: Artur Shaik ashaihullin@gmail.com
This change is