From 61bf47d24bdcecc4f870a5d54b1374b86bdfb955 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 7 May 2019 09:01:18 +0200 Subject: [PATCH] Migrate to pynvim --- Dockerfile | 2 +- rplugin/python3/neotags.py | 8 ++++---- rplugin/test/test_neotags.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 74e9cfb..cd7049c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/rplugin/python3/neotags.py b/rplugin/python3/neotags.py index f7115e3..a04a57e 100644 --- a/rplugin/python3/neotags.py +++ b/rplugin/python3/neotags.py @@ -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(":p")') + @pynvim.autocmd('BufWritePost', pattern='*', eval='expand(":p")') def update_tags_for_file(self, filename): self.update_settings() diff --git a/rplugin/test/test_neotags.py b/rplugin/test/test_neotags.py index 78af374..af2766d 100644 --- a/rplugin/test/test_neotags.py +++ b/rplugin/test/test_neotags.py @@ -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'])