diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-10-15 14:15:20 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-10-15 14:15:32 +0900 |
commit | 667504f4372968494c47fb880d4f18cf602edaa6 (patch) | |
tree | e7984622c3344af51909020322859ac7943d4b3d /rplugin/python3/deoplete/util.py | |
parent | a67f73332e7e0821bf4e70761b4cb694d0f83039 (diff) | |
download | deoplete.nvim-667504f4372968494c47fb880d4f18cf602edaa6.zip |
Fix #353 neovim-python crash
Diffstat (limited to 'rplugin/python3/deoplete/util.py')
-rw-r--r-- | rplugin/python3/deoplete/util.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rplugin/python3/deoplete/util.py b/rplugin/python3/deoplete/util.py index 760ad3f..ab12a9c 100644 --- a/rplugin/python3/deoplete/util.py +++ b/rplugin/python3/deoplete/util.py @@ -211,3 +211,15 @@ def charwidth(c): def expand(path): return os.path.expandvars(os.path.expanduser(path)) + + +def getlines(vim, start=1, end='$'): + if end == '$': + end = len(vim.current.buffer) + max = 5000 + lines = [] + current = start + while current <= end: + lines += vim.call('getline', current, current + max) + current += max + 1 + return lines |