Migrate to pynvim

This commit is contained in:
Daniel Siepmann 2019-05-07 09:01:18 +02:00
parent ff8946411e
commit 61bf47d24b
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
3 changed files with 7 additions and 7 deletions

View file

@ -5,4 +5,4 @@ LABEL Description="This image should provide environment to lint neotags" Vendor
# Install dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir pep8 neovim pyfakefs==3.1
RUN pip install --no-cache-dir pep8 pynvim pyfakefs==3.1

View file

@ -1,4 +1,4 @@
import neovim
import pynvim
import fileinput
import pathlib
import subprocess
@ -6,7 +6,7 @@ import sys
import traceback
@neovim.plugin
@pynvim.plugin
class NeotagsPlugin(object):
def __init__(self, nvim):
@ -25,11 +25,11 @@ class NeotagsPlugin(object):
try:
variable = 'neotags_%s' % option
self.options[option] = self.nvim.vars[variable]
except neovim.api.nvim.NvimError:
except pynvim.api.nvim.NvimError:
self.options[option] = default
# Check whether 'FileWritePost' is necessary
@neovim.autocmd('BufWritePost', pattern='*', eval='expand("<afile>:p")')
@pynvim.autocmd('BufWritePost', pattern='*', eval='expand("<afile>:p")')
def update_tags_for_file(self, filename):
self.update_settings()

View file

@ -1,7 +1,7 @@
from unittest.mock import Mock
from unittest.mock import MagicMock
from pyfakefs import fake_filesystem_unittest
import neovim
import pynvim
import os
from python3.neotags import NeotagsPlugin
@ -15,7 +15,7 @@ class TestNeotagsPlugin(fake_filesystem_unittest.TestCase):
'templates'
)
self.setUpPyfakefs()
self.plugin = NeotagsPlugin(Mock(neovim.api.nvim))
self.plugin = NeotagsPlugin(Mock(pynvim.api.nvim))
def test_default_options(self):
self.assertEqual('ctags', self.plugin.options['ctags_cmd'])