The calculation to determine how many spaces to use when padding
columns wasn't taking into account the length of the 'same' portion of
the completions and was only using the length of the completion
itself. This frequently caused the printed completions to wrap, making
the completion list much harder to read.
It is possible for `opHistory.Rewrite` to be called from
`opHistory.historyUpdatePath`. This is problematic, because both methods
grab a lock, and Mutexes in go are not reentrant. This change pulls out
the logic in Rewrite into `opHistory.rewriteLocked`, and retains the
public facing method.
I updated the switch in vim.go to treat 'w' and 'W' differently to 'e' and 'E'.
I then added a method to runebuf.go to provide the logic for that motion.
tested and working.
* Dynamic autocompletion implemented
Now there is a new item type "PcItemDynamic" which takes function as
parameter.
When it comes to autocomplete at this position, the function is called,
the whole line is given to it (for example if autocompletion depend on
previous autocompleted field) and functio should return possible strings
how to continue.
Example usage:
* listing some dynamic key-value storage
* listing files in directory
* Dynamic autocompletion: Updated example
* Dynamic autocompletion: Internal Do() is passing the original full line
To serve it to dynamic autocompletion functions. Previously passed line
was only following segment (which doesn't work).
* Dynamic autocompletion: New dynamic interface added + type assertion in Do function
Do function was split into doInternal with changed declaration and Do
with original declaration.
* Add ClearScreen operation on Ctrl+L
* Remove TODO from clear screen in readme
* Don't use external command for ClearScreen
* Remove duplicate ClearScreen function