[vim keymap] Fix bugs in line handling

Closes #1612
Fix bug in addLineWidget / insertAt implementation

(f674dd148c27c882d3a85885caa9c27bb5638ee5)