YouCompleteMe/python/ycm/tests
zzbot c3b4884cd3
Auto merge of #3126 - micbou:fix-cursor-position-replace-chunk, r=micbou
[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 -->
2018-09-09 05:36:16 -07:00
..
client Support modifiers for GoTo commands 2018-07-24 18:07:41 +02:00
testdata Tests for checking that extra_conf_data sended to server from :DebugInfo and :YcmCompleter commands. 2017-03-12 19:03:07 +03:00
__init__.py Allow users to change the options by restarting the server 2018-05-15 23:45:54 +02:00
base_test.py Add flake8-ycm to test requirements 2018-05-30 02:53:28 +02:00
command_test.py Support modifiers for GoTo commands 2018-07-24 18:07:41 +02:00
completion_test.py Update matches for all windows 2018-06-03 18:58:09 +02:00
diagnostic_filter_test.py Add flake8-ycm to test requirements 2018-05-30 02:53:28 +02:00
event_notification_test.py Update JavaScript support and documentation 2018-07-25 22:15:01 +02:00
mock_utils.py Add support for Java diagnostics and asynchronous messages 2018-02-10 16:29:27 +00:00
omni_completer_test.py Improve omnifunc compliance when start column is invalid 2018-09-09 12:34:07 +02:00
paths_test.py Drop Python 2.6 and Python 3.3 2018-01-30 18:34:50 +01:00
postcomplete_test.py Add flake8-ycm to test requirements 2018-05-30 02:53:28 +02:00
syntax_parse_test.py Do not install aliases from future 2017-03-18 18:24:48 +01:00
test_utils.py Only use command modifiers if available 2018-08-14 13:52:25 +02:00
vimsupport_test.py Fix cursor position when replacing chunk 2018-09-09 12:38:44 +02:00
youcompleteme_test.py Update matches for all windows 2018-06-03 18:58:09 +02:00