diff --git a/src/prompt_toolkit/application/current.py b/src/prompt_toolkit/application/current.py index e3a5b8769..33828024f 100644 --- a/src/prompt_toolkit/application/current.py +++ b/src/prompt_toolkit/application/current.py @@ -35,7 +35,7 @@ class AppSession: :param input: Use this as a default input for all applications running in this session, unless an input is passed to the `Application` - explicitely. + explicitly. :param output: Use this as a default output. """ diff --git a/src/prompt_toolkit/buffer.py b/src/prompt_toolkit/buffer.py index b83934a6e..8edc01d1e 100644 --- a/src/prompt_toolkit/buffer.py +++ b/src/prompt_toolkit/buffer.py @@ -1589,12 +1589,12 @@ async def run() -> None: # (We need to use `run_in_terminal`, because not all editors go to # the alternate screen buffer, and some could influence the cursor # position.) - succes = await run_in_terminal( + success = await run_in_terminal( lambda: self._open_file_in_editor(filename), in_executor=True ) # Read content again. - if succes: + if success: with open(filename, "rb") as f: text = f.read().decode("utf-8") diff --git a/src/prompt_toolkit/contrib/telnet/server.py b/src/prompt_toolkit/contrib/telnet/server.py index d2a79cae9..5730a3b0b 100644 --- a/src/prompt_toolkit/contrib/telnet/server.py +++ b/src/prompt_toolkit/contrib/telnet/server.py @@ -64,7 +64,7 @@ def _initialize_telnet(connection: socket.socket) -> None: connection.send(IAC + DO + NAWS) # Negotiate terminal type - # Assume the client will accept the negociation with `IAC + WILL + TTYPE` + # Assume the client will accept the negotiation with `IAC + WILL + TTYPE` connection.send(IAC + DO + TTYPE) # We can then select the first terminal type supported by the client, diff --git a/src/prompt_toolkit/cursor_shapes.py b/src/prompt_toolkit/cursor_shapes.py index adf6bca01..453b72c3c 100644 --- a/src/prompt_toolkit/cursor_shapes.py +++ b/src/prompt_toolkit/cursor_shapes.py @@ -26,7 +26,7 @@ class CursorShape(Enum): # before this `CursorShape` functionality was introduced into # prompt_toolkit itself, people had workarounds to send cursor shapes # escapes into the terminal, by monkey patching some of prompt_toolkit's - # internals. We don't want the default prompt_toolkit implemetation to + # internals. We don't want the default prompt_toolkit implementation to # interfere with that. E.g., IPython patches the `ViState.input_mode` # property. See: https://github.com/ipython/ipython/pull/13501/files _NEVER_CHANGE = "_NEVER_CHANGE" diff --git a/src/prompt_toolkit/input/vt100.py b/src/prompt_toolkit/input/vt100.py index 146790323..c1660de95 100644 --- a/src/prompt_toolkit/input/vt100.py +++ b/src/prompt_toolkit/input/vt100.py @@ -165,7 +165,7 @@ def callback_wrapper() -> None: loop.add_reader(fd, callback_wrapper) except PermissionError: # For `EPollSelector`, adding /dev/null to the event loop will raise - # `PermisisonError` (that doesn't happen for `SelectSelector` + # `PermissionError` (that doesn't happen for `SelectSelector` # apparently). Whenever we get a `PermissionError`, we can raise # `EOFError`, because there's not more to be read anyway. `EOFError` is # an exception that people expect in diff --git a/src/prompt_toolkit/key_binding/bindings/vi.py b/src/prompt_toolkit/key_binding/bindings/vi.py index d40baa017..436a553c1 100644 --- a/src/prompt_toolkit/key_binding/bindings/vi.py +++ b/src/prompt_toolkit/key_binding/bindings/vi.py @@ -1030,7 +1030,7 @@ def _swapcase_line(event: E) -> None: buff.transform_current_line(lambda s: s.swapcase()) @handle("#", filter=vi_navigation_mode) - def _prev_occurence(event: E) -> None: + def _prev_occurrence(event: E) -> None: """ Go to previous occurrence of this word. """ @@ -1043,7 +1043,7 @@ def _prev_occurence(event: E) -> None: b.apply_search(search_state, count=event.arg, include_current_position=False) @handle("*", filter=vi_navigation_mode) - def _next_occurance(event: E) -> None: + def _next_occurrence(event: E) -> None: """ Go to next occurrence of this word. """ @@ -1411,7 +1411,7 @@ def _next_section(event: E) -> TextObject: return TextObject(index) @text_object("f", Keys.Any) - def _next_occurence(event: E) -> TextObject: + def _find_next_occurrence(event: E) -> TextObject: """ Go to next occurrence of character. Typing 'fx' will move the cursor to the next occurrence of character. 'x'. @@ -1426,7 +1426,7 @@ def _next_occurence(event: E) -> TextObject: return TextObject(0) @text_object("F", Keys.Any) - def _previous_occurance(event: E) -> TextObject: + def _find_previous_occurrence(event: E) -> TextObject: """ Go to previous occurrence of character. Typing 'Fx' will move the cursor to the previous occurrence of character. 'x'. diff --git a/src/prompt_toolkit/key_binding/key_bindings.py b/src/prompt_toolkit/key_binding/key_bindings.py index 5e7b056af..6abb595da 100644 --- a/src/prompt_toolkit/key_binding/key_bindings.py +++ b/src/prompt_toolkit/key_binding/key_bindings.py @@ -58,7 +58,7 @@ def my_key_binding(event): # Avoid circular imports. from .key_processor import KeyPressEvent - # The only two return values for a mouse hander (and key bindings) are + # The only two return values for a mouse handler (and key bindings) are # `None` and `NotImplemented`. For the type checker it's best to annotate # this as `object`. (The consumer never expects a more specific instance: # checking for NotImplemented can be done using `is NotImplemented`.) diff --git a/src/prompt_toolkit/layout/containers.py b/src/prompt_toolkit/layout/containers.py index 2209ebdbd..bcbf35d05 100644 --- a/src/prompt_toolkit/layout/containers.py +++ b/src/prompt_toolkit/layout/containers.py @@ -2365,7 +2365,7 @@ def get_line_height(lineno: int) -> int: self.vertical_scroll_2 = min( text_before_height - 1, # Keep the cursor visible. line_height - - height, # Avoid blank lines at the bottom when scolling up again. + - height, # Avoid blank lines at the bottom when scrolling up again. self.vertical_scroll_2, ) self.vertical_scroll_2 = max( diff --git a/src/prompt_toolkit/layout/scrollable_pane.py b/src/prompt_toolkit/layout/scrollable_pane.py index eac38610d..e38fd7619 100644 --- a/src/prompt_toolkit/layout/scrollable_pane.py +++ b/src/prompt_toolkit/layout/scrollable_pane.py @@ -39,9 +39,9 @@ class ScrollablePane(Container): top/bottom (left/right offset is not used). :param keep_cursor_visible: When `True`, automatically scroll the pane so that the cursor (of the focused window) is always visible. - :param keep_focused_window_visible: When `True`, automatically scroll th e + :param keep_focused_window_visible: When `True`, automatically scroll the pane so that the focused window is visible, or as much visible as - possible if it doen't completely fit the screen. + possible if it doesn't completely fit the screen. :param max_available_height: Always constraint the height to this amount for performance reasons. :param width: When given, use this width instead of looking at the children. diff --git a/src/prompt_toolkit/output/base.py b/src/prompt_toolkit/output/base.py index ff21f8599..6b06a50ee 100644 --- a/src/prompt_toolkit/output/base.py +++ b/src/prompt_toolkit/output/base.py @@ -206,7 +206,7 @@ def get_default_color_depth(self) -> ColorDepth: """ Get default color depth for this output. - This value will be used if no color depth was explicitely passed to the + This value will be used if no color depth was explicitly passed to the `Application`. .. note:: diff --git a/src/prompt_toolkit/output/win32.py b/src/prompt_toolkit/output/win32.py index 66e6a25bc..c93ec7de3 100644 --- a/src/prompt_toolkit/output/win32.py +++ b/src/prompt_toolkit/output/win32.py @@ -375,7 +375,7 @@ def flush(self) -> None: self.LOG.flush() # Print characters one by one. This appears to be the best solution - # in oder to avoid traces of vertical lines when the completion + # in order to avoid traces of vertical lines when the completion # menu disappears. for b in data: written = DWORD() diff --git a/src/prompt_toolkit/utils.py b/src/prompt_toolkit/utils.py index fef28beee..8cd9fae10 100644 --- a/src/prompt_toolkit/utils.py +++ b/src/prompt_toolkit/utils.py @@ -220,7 +220,7 @@ def in_main_thread() -> bool: def get_bell_environment_variable() -> bool: """ - True if env variable is set to true (true, TRUE, TrUe, 1). + True if env variable is set to true (true, TRUE, True, 1). """ value = os.environ.get("PROMPT_TOOLKIT_BELL", "true") return value.lower() in ("1", "true")