summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-02-08 19:31:38 +0000
committerw0rp <devw0rp@gmail.com>2019-02-08 19:31:47 +0000
commitd21581016ec7008afb00ea8e938505549a1136e9 (patch)
tree498aea516041a3763db7e86bc074188aa925db84
parent800d029b4684076d22c67fc199c250e0f0f32636 (diff)
downloadale-d21581016ec7008afb00ea8e938505549a1136e9.zip
Fix #2257 - Fix an off by 1 which broke completion for some servers
-rw-r--r--autoload/ale/completion.vim4
-rw-r--r--test/completion/test_lsp_completion_messages.vader4
2 files changed, 4 insertions, 4 deletions
diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim
index d0e27cc4..8a96032e 100644
--- a/autoload/ale/completion.vim
+++ b/autoload/ale/completion.vim
@@ -480,8 +480,8 @@ function! s:OnReady(linter, lsp_details, ...) abort
\ b:ale_completion_info.line,
\ min([
\ b:ale_completion_info.line_length,
- \ b:ale_completion_info.column + 1,
- \ ]),
+ \ b:ale_completion_info.column,
+ \ ]) + 1,
\ 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 f670e186..130f31b9 100644
--- a/test/completion/test_lsp_completion_messages.vader
+++ b/test/completion/test_lsp_completion_messages.vader
@@ -215,7 +215,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': 2},
+ \ 'position': {'line': 0, 'character': 3},
\ }],
\ ],
\ g:message_list
@@ -274,7 +274,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': 2},
+ \ 'position': {'line': 0, 'character': 3},
\ }],
\ ],
\ g:message_list