Move writing and updating the file being edited to s:IdrisCommand (removes a lot of code duplication)
Move saving the window view to IWrite (this guarantees that the window always returns to it's previous position. The reload command used to save just the cursor position, not the whole window view, and that caused annoyances)
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.
The refactors were:
s:IdrisCommand
(removes a lot of code duplication)IWrite
(this guarantees that the window always returns to it's previous position. The reload command used to save just the cursor position, not the whole window view, and that caused annoyances)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 thehidden
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.