I started my "let's split all the tests into tinier pieces" adventure by writing more tests for the replace mode. The final result is this patch, that contains:
- More tests.
- Fixed a crash: when you typed Ctrl-E (or Ctrl-Y) in an empty document, it crashed. This is because in the first if statement of the commandInsertFromLine function, it should be >= instead of > (such a classic fix :P).
- Fixed a crash: when you typed Ctrl-E (or Ctrl-Y) and the cursor was at the end of the line, it crashed. This was fixed by calling doc()->insertText() for this case. Moreover, I took the chance to clean up the commandInsertFromLine function a bit. Most notably, instead of calling the cumbersome getCharAtVirtualColumn function now it will call the doc()->characterAt() function.
- I took the chance to clean up the whole KateViReplaceMode class (probably it should've been in another patch, sorry about that :P).
|