diff --git a/mathicsscript/bindkeys.py b/mathicsscript/bindkeys.py index 755c521..5c82aeb 100644 --- a/mathicsscript/bindkeys.py +++ b/mathicsscript/bindkeys.py @@ -13,6 +13,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +""" +Keyboard input binding routines for prompt_toolkit which are +analogous to GNU Readlines' parse_and_bind(). +""" + from typing import Callable from prompt_toolkit.enums import EditingMode from prompt_toolkit.key_binding import KeyBindings @@ -136,7 +141,7 @@ def read_inputrc(read_init_file_fn: Callable, use_unicode: bool) -> None: """ Read GNU Readline style inputrc """ - # GNU Readling inputrc $include's paths are relative to itself, + # GNU Readline inputrc $include's paths are relative to itself, # so chdir to its directory before reading the file. parent_dir = pathlib.Path(__file__).parent.absolute() with parent_dir: diff --git a/mathicsscript/completion.py b/mathicsscript/completion.py index 6258d22..c70cc4a 100644 --- a/mathicsscript/completion.py +++ b/mathicsscript/completion.py @@ -83,7 +83,7 @@ def __init__(self, definitions): self.escape_sequences = aliased_characters.keys() - def _is_space_before_cursor(self, document, text_before_cursor: str) -> bool: + def _is_space_before_cursor(self, text_before_cursor: str) -> bool: """Space before or no text before cursor.""" return text_before_cursor == "" or text_before_cursor[-1:].isspace() @@ -135,9 +135,7 @@ def get_word_before_cursor_with_kind( text_before_cursor = document.text_before_cursor - if self._is_space_before_cursor( - document=document, text_before_cursor=text_before_cursor - ): + if self._is_space_before_cursor(text_before_cursor=text_before_cursor): return WordToken("", TokenKind.Null) start = (