From 581cba4fe027b4e02619ad69cc672c742e45cce1 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 3 Jul 2021 09:06:09 -0700 Subject: [PATCH] docs: fix a few simple typos (#490) Closes #487 Co-authored-by: Tim Gates --- docs/usage/python-plugin-api.rst | 2 +- pynvim/__init__.py | 4 ++-- pynvim/api/buffer.py | 6 +++--- pynvim/msgpack_rpc/async_session.py | 2 +- scripts/logging_statement_modifier.py | 2 +- test/test_decorators.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/usage/python-plugin-api.rst b/docs/usage/python-plugin-api.rst index 3b02cc11..de21af0c 100644 --- a/docs/usage/python-plugin-api.rst +++ b/docs/usage/python-plugin-api.rst @@ -86,7 +86,7 @@ root, and use ``vim.exec_lua("_testplugin = require('testplugin')")``. In both cases, replace ``testplugin`` with a unique string based on your plugin name. -Then, the module can be acessed as ``vim.lua._testplugin``. +Then, the module can be accessed as ``vim.lua._testplugin``. .. code-block:: python diff --git a/pynvim/__init__.py b/pynvim/__init__.py index 17967ce2..ba180f1e 100644 --- a/pynvim/__init__.py +++ b/pynvim/__init__.py @@ -98,12 +98,12 @@ def attach(session_type, address=None, port=None, When the session is not needed anymore, it is recommended to explicitly close it: nvim.close() - It is also possible to use the session as a context mangager: + It is also possible to use the session as a context manager: with attach('socket', path=thepath) as nvim: print(nvim.funcs.getpid()) print(nvim.current.line) This will automatically close the session when you're done with it, or - when an error occured. + when an error occurred. """ diff --git a/pynvim/api/buffer.py b/pynvim/api/buffer.py index a9920545..4623bfd9 100644 --- a/pynvim/api/buffer.py +++ b/pynvim/api/buffer.py @@ -37,7 +37,7 @@ def __getitem__(self, idx): buffer. For example, -1 is the last line, -2 is the line before that and so on. - When retrieving slices, omiting indexes(eg: `buffer[:]`) will bring + When retrieving slices, omitting indexes(eg: `buffer[:]`) will bring the whole buffer. """ if not isinstance(idx, slice): @@ -52,7 +52,7 @@ def __setitem__(self, idx, item): Like with `__getitem__`, indexes may be negative. - When replacing slices, omiting indexes(eg: `buffer[:]`) will replace + When replacing slices, omitting indexes(eg: `buffer[:]`) will replace the whole buffer. """ if not isinstance(idx, slice): @@ -69,7 +69,7 @@ def __iter__(self): This will retrieve all lines locally before iteration starts. This approach is used because for most cases, the gain is much greater by - minimizing the number of API calls by transfering all data needed to + minimizing the number of API calls by transferring all data needed to work. """ lines = self[:] diff --git a/pynvim/msgpack_rpc/async_session.py b/pynvim/msgpack_rpc/async_session.py index b6d19098..333c6cf2 100644 --- a/pynvim/msgpack_rpc/async_session.py +++ b/pynvim/msgpack_rpc/async_session.py @@ -50,7 +50,7 @@ def notify(self, method, args): A msgpack-rpc with method `method` and argument `args` is sent to Nvim. This will have the same effect as a request, but no response - will be recieved + will be received """ self._msgpack_stream.send([2, method, args]) diff --git a/scripts/logging_statement_modifier.py b/scripts/logging_statement_modifier.py index a032ac84..c4fbeb78 100755 --- a/scripts/logging_statement_modifier.py +++ b/scripts/logging_statement_modifier.py @@ -264,7 +264,7 @@ def modify_logging(input_fn, output_fn, min_level_value, max_level_value, restor def check_level(logging_stmt, logging_stmt_is_commented_out, min_level_value, max_level_value): """Extracts the level of the logging statement and returns True if the - level falls betwen min and max_level_value. If the level cannot be + level falls between min and max_level_value. If the level cannot be extracted, then a warning is logged.""" level = get_logging_level(logging_stmt, logging_stmt_is_commented_out) if level is None: diff --git a/test/test_decorators.py b/test/test_decorators.py index 0f9d9370..6e578a1d 100644 --- a/test/test_decorators.py +++ b/test/test_decorators.py @@ -15,7 +15,7 @@ def function(): decorated = command('test', count=count_value)(function) assert 'count' not in decorated._nvim_rpc_spec['opts'] - # Test presesence with value of 0 + # Test precedence with value of 0 count_value = 0 decorated = command('test', count=count_value)(function) assert 'count' in decorated._nvim_rpc_spec['opts']