edwinb / idris2-vim

Vim mode for Idris 2
75 stars 26 forks source link

Refactor and add the TypeAt command #24

Open GustavoMF31 opened 3 years ago

GustavoMF31 commented 3 years ago

The refactors were:

A change made that isn't really a refactor is that now undo still works after issuing a command that updates the idris-response buffer. Previously, the process of writing to it made the buffer with the current file be temporarily abandoned, causing the undo history to be lost. The fix is implemented by temporarily overwriting the hidden option, making it become a hidden buffer, rather than abandoned. There might be a more straightforward way of implementing this though, suggestions are welcomed.

The implementation of TypeAt is rather simple. I'm not sure about which key would be the best for it though. My initial idea was <LocalLeader>ta, TypeAt's initials, but that would make Vim wait for a second keypress before issuing a regular <LocalLeader>t, which is rather inconvenient. I settled on <LocalLeader>y for lack of anything better.

I'm sorry if I ended up coupling too many unrelated changes into this pull request, i'm kind of still learning how to help with open source. If any changes are necessary just let me know and I'll do my best.