summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-05-30 10:26:09 +0100
committerw0rp <devw0rp@gmail.com>2019-05-30 10:26:17 +0100
commit27146ade32d6686fefde27de76b65bcdf353eab5 (patch)
tree981537646e5cd759c514648bb8afea379704769c
parent4f02edc3f882e6cb77b8dc03bc118172cfe5d857 (diff)
downloadale-27146ade32d6686fefde27de76b65bcdf353eab5.zip
Fix #2544 - Completion positions are off by one
-rw-r--r--autoload/ale/completion.vim5
-rw-r--r--test/completion/test_lsp_completion_messages.vader4
2 files changed, 3 insertions, 6 deletions
diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim
index 9158f227..ee156056 100644
--- a/autoload/ale/completion.vim
+++ b/autoload/ale/completion.vim
@@ -521,10 +521,7 @@ function! s:OnReady(linter, lsp_details) abort
let l:message = ale#lsp#message#Completion(
\ l:buffer,
\ b:ale_completion_info.line,
- \ min([
- \ b:ale_completion_info.line_length,
- \ b:ale_completion_info.column,
- \ ]) + 1,
+ \ b:ale_completion_info.column,
\ ale#completion#GetTriggerCharacter(&filetype, b:ale_completion_info.prefix),
\)
endif
diff --git a/test/completion/test_lsp_completion_messages.vader b/test/completion/test_lsp_completion_messages.vader
index 9598e5f0..6bd241a8 100644
--- a/test/completion/test_lsp_completion_messages.vader
+++ b/test/completion/test_lsp_completion_messages.vader
@@ -219,7 +219,7 @@ Execute(The right message should be sent for the initial LSP request):
\ }],
\ [0, 'textDocument/completion', {
\ 'textDocument': {'uri': ale#path#ToURI(expand('%:p'))},
- \ 'position': {'line': 0, 'character': 3},
+ \ 'position': {'line': 0, 'character': 2},
\ }],
\ ],
\ g:message_list
@@ -280,7 +280,7 @@ Execute(Two completion requests shouldn't be sent in a row):
\ }],
\ [0, 'textDocument/completion', {
\ 'textDocument': {'uri': ale#path#ToURI(expand('%:p'))},
- \ 'position': {'line': 0, 'character': 3},
+ \ 'position': {'line': 0, 'character': 2},
\ }],
\ ],
\ g:message_list