Skip to content

Commit 3657a35

Browse files
committed
Small tweaks...
bindkey.py; Add docstring, and fix a docstring typo completion.py: remove an unneeded parameter
1 parent 7ede68b commit 3657a35

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

mathicsscript/bindkeys.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# You should have received a copy of the GNU General Public License
1414
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515

16+
"""
17+
Keyboard input binding routines for prompt_toolkit which are
18+
analogous to GNU Readlines' parse_and_bind().
19+
"""
20+
1621
from typing import Callable
1722
from prompt_toolkit.enums import EditingMode
1823
from prompt_toolkit.key_binding import KeyBindings
@@ -136,7 +141,7 @@ def read_inputrc(read_init_file_fn: Callable, use_unicode: bool) -> None:
136141
"""
137142
Read GNU Readline style inputrc
138143
"""
139-
# GNU Readling inputrc $include's paths are relative to itself,
144+
# GNU Readline inputrc $include's paths are relative to itself,
140145
# so chdir to its directory before reading the file.
141146
parent_dir = pathlib.Path(__file__).parent.absolute()
142147
with parent_dir:

mathicsscript/completion.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, definitions):
8383

8484
self.escape_sequences = aliased_characters.keys()
8585

86-
def _is_space_before_cursor(self, document, text_before_cursor: str) -> bool:
86+
def _is_space_before_cursor(self, text_before_cursor: str) -> bool:
8787
"""Space before or no text before cursor."""
8888
return text_before_cursor == "" or text_before_cursor[-1:].isspace()
8989

@@ -135,9 +135,7 @@ def get_word_before_cursor_with_kind(
135135

136136
text_before_cursor = document.text_before_cursor
137137

138-
if self._is_space_before_cursor(
139-
document=document, text_before_cursor=text_before_cursor
140-
):
138+
if self._is_space_before_cursor(text_before_cursor=text_before_cursor):
141139
return WordToken("", TokenKind.Null)
142140

143141
start = (

0 commit comments

Comments
 (0)