c3b4884cd3
[READY] Fix cursor position when replacing chunk When replacing an area of the buffer with `ReplaceChunk`, we are replacing the whole last line of that area because the Python interface doesn't allow changing only some part of a line. If the cursor is positioned on that line just after the ending column of the replaced area, we expect the cursor to be moved depending on the amount of text replaced. However, since the whole line is replaced, Vim cannot figure where the cursor should be positioned and so the cursor is not moved. This leads to the cursor ending in an unexpected position after a FixIt is applied. Here's an illustration of the issue in TypeScript where an import statement is automatically inserted after selecting a completion: ![fixit-cursor-position-before](https://user-images.githubusercontent.com/10026824/44363871-be1ec400-a4c5-11e8-949b-14ada91bdc5e.gif) The solution is to manually move the cursor in that case: ![fixit-cursor-position-after](https://user-images.githubusercontent.com/10026824/44364038-3a190c00-a4c6-11e8-8aca-4bc8ccb98edc.gif) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3126) <!-- Reviewable:end --> |
||
---|---|---|
.. | ||
client | ||
testdata | ||
__init__.py | ||
base_test.py | ||
command_test.py | ||
completion_test.py | ||
diagnostic_filter_test.py | ||
event_notification_test.py | ||
mock_utils.py | ||
omni_completer_test.py | ||
paths_test.py | ||
postcomplete_test.py | ||
syntax_parse_test.py | ||
test_utils.py | ||
vimsupport_test.py | ||
youcompleteme_test.py |