summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2020-11-20 19:10:55 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2020-11-20 19:10:55 +0900
commit8249a0f2f27a84aa33116e392f4e79bcb20864b8 (patch)
treec4547fc27d1017dc48694def71186bb1e2e2a4ef
parent58db1b1c80d67dd0f48c8224c4e4d737885a2f65 (diff)
downloaddeoplete.nvim-8249a0f2f27a84aa33116e392f4e79bcb20864b8.zip
Improve converter_remove_overlap
-rw-r--r--rplugin/python3/deoplete/filter/converter_remove_overlap.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/rplugin/python3/deoplete/filter/converter_remove_overlap.py b/rplugin/python3/deoplete/filter/converter_remove_overlap.py
index 5de8985..8f0941f 100644
--- a/rplugin/python3/deoplete/filter/converter_remove_overlap.py
+++ b/rplugin/python3/deoplete/filter/converter_remove_overlap.py
@@ -28,10 +28,12 @@ class Filter(Base):
cur_pos = self.vim.call('getcurpos')[1:3]
check_pairs = []
pair_pos = self.vim.call('searchpairpos', '(', '', ')', 'nW')
- if cur_pos < pair_pos and cur_pos[0] == pair_pos[0]:
+ if ('(' in context['input'] and cur_pos < pair_pos and
+ cur_pos[0] == pair_pos[0]):
check_pairs.append(['(', ')', pair_pos])
pair_pos = self.vim.call('searchpairpos', '[', '', ']', 'nW')
- if cur_pos < pair_pos and cur_pos[0] == pair_pos[0]:
+ if ('[' in context['input'] and cur_pos < pair_pos and
+ cur_pos[0] == pair_pos[0]):
check_pairs.append(['[', ']', pair_pos])
for [overlap, candidate, word] in [