Skip to content

Commit

Permalink
Fix various typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanslenders committed Apr 12, 2023
1 parent cd2c238 commit 564ff54
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/prompt_toolkit/application/current.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down
4 changes: 2 additions & 2 deletions src/prompt_toolkit/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/contrib/telnet/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/cursor_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/input/vt100.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/prompt_toolkit/key_binding/bindings/vi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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.
"""
Expand Down Expand Up @@ -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'.
Expand All @@ -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'.
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/key_binding/key_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.)
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/layout/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/prompt_toolkit/layout/scrollable_pane.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/output/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/output/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/prompt_toolkit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 564ff54

Please sign in to comment.