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
Visual mode doesn't work on text objects (vim) #887
Comments
Are you using dyre? If so, did you remember to remove your cached yi binary? If you don't remove it, and you don't change your config, all your changes have no effect. Sorry, I'm not often on IRC and I should be on it more. Btw, the old binding is in
That said I don't think I understand what the bug is here, I can't seem to get different behavior between vim and yi for pressing v. Vim also immediately starts selection. |
Yi is lacking the ability to select text objects (in visual mode). Edit: TextObjects are already implemented in |
@jhance is it |
@noughtmare I already found how to do it, it's pretty easy. There's a file Specifically, those commands simply accept a region (which is a text object here), and working on it. So I have just to write a function working on a region, and probably to add it somewhere besides the file. I already wrote the code :Ь But I stuck on the silliest stage: I just can't remove that old keybinding! (and no, it's not the code I wrote triggering, I commented it out yet). |
The issue is probably that you're not using your custom yi project in your configuration. How do you install your customized yi project, do you use stack or cabal? Is your configuration ( |
@noughtmare I have only a single Yi source code, cloned from here. To build it I use |
@noughtmare perhaps you misunderstood me: I don't want to remove that old keybinding from the |
When you launch yi, it checks if your configuration has changed and recompiles the configuration if necessary. The configuration will use the (systemwide) installed version of yi when recompiling (so it won't use your custom yi). To make your yi configuration use your custom yi, you have to run I like to use stack, because you can explicitly say which yi you want to use (cabal also has some other issues). I can't easily explain how to get yi working with stack, but we're working on simplifying the installation and configuration process (so even if I would explain it now it will probably change soon). |
Wow, you're right! After Yeah, I know about cabal hell issue which led to stack creation, but with regard to Haskell in closest time I'm planning to work only with Yi to set it in more or less usable state to replace my Emacs+Evil before moving on. So cabal hell hardly would be a problem, at least not very soon. |
Turned out I was wrong — I'm wondering: can I build yi for profiling without installing profiling libs (i'm not interested in anything besides Yi)? It's that I'm stuck: method |
We have profiling instructions, but I don't know if they're up to date. I have never really done Haskell profiling, so I can't help you with that. I think you also need to |
I believe those profile instructions were up to date, at least prior to the split packages. You cannot install Yi for profiling without the profiling libs, because we execute code in those libs and thus they have to be profiled :) And noughtmare is correct on the mode switching, because |
Yay, thank you very much, it works now! I have a question though. I'm afraid whether removing this line would break anything; does anybody know, what the I see that it referenced in EDIT: in fact, I don't know where the function creating text object is defined. But |
Shall I make a separate file for sole purpose of |
SGTM I have to admit i dont know what a text object actually is... |
In fact it is possible to just copy the function into |
No copy pasterino |
Btw can you confirm to me what the bug is? In vim if I press |
Yes. And if you press Sorry, I gtg now. |
Btw, |
Ok I see. So it shouldn't affect the transition to visual mode then right? It should just be the |
I'm not sure I understood you, but I just made it an operator, like From what I tested it seems to work exactly as should. |
@noughtmare oh, you're right! I didn't know that visual selection allows to enter Then, probably, I should fix it the other way than I did now. I ought to leave keybindings as is (in particular there's nothing to add to Operator.hs), and to look at the keybindings for visual mode. |
Yes, this is why I was confused |
Oh, it is so confusing… ☹ I spent a few hours wading through the code, and so far I come up with this: there's a There's also I should thank peoples though, who set comments all over the code — without them I'd spend a few hours in the code. I'm stuck :( |
Oh, I declare the breaktrough, I have to try to work with |
@ethercrow I don't understand, where it is committed? E.g. when I look the MatchResult.hs, I didn't see the committed changes. And your fork didn't have them either. |
He pushed them to the This is the diff of his commit: 610989e |
I have a question. I can't seem to get to work |
Aha… I seem to find that… The output appears in the Is it a bug, or do I do something wrong? |
When I'm working on vim keymap, my usual debugging tools are |
@ethercrow well, Anyway, while I'm figuring out how to get this branch into my fork (btw, I figured it out that I should've used |
@Hi-Angel the If |
As title says… When I press "v" in normal mode (vim keymap), it immediately starts selection instead of waiting for a text object.
I'm sorry, I actually didn't want to report a bug, I tried to fix it for getting more familiar with the code, and I even wrote some code for Operators.hs. But the problem is that I stuck on removing the old keybinding. I grepped all over the code for
"v"
,'v'
, and even a regexp".*v.*"
, I removed everything seemingly relevant; however after compilation "v" starts selection again and again.How do I remove that old keybinding? I asked on IRC, but nobody seem to know anything. I also tried asking on mailing list one or two days ago, but my mails for some reason didn't appear there.
The text was updated successfully, but these errors were encountered: