Skip to content

Commit

Permalink
micro-optimization for dictation_insert (talonhub#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
rntz authored Apr 23, 2024
1 parent 23e371f commit 027d7d0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/text/text_and_dictation.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,8 @@ def dictation_insert(text: str, auto_cap: bool = True) -> str:
# peek right if we might need trailing space. NB. We peek right
# BEFORE insertion to avoid breaking the undo-chain between the
# inserted text and the trailing space.
need_left = (
not omit_space_before(text)
or text != auto_capitalize(text, "sentence start")[0]
need_left = not omit_space_before(text) or (
auto_cap and text != auto_capitalize(text, "sentence start")[0]
)
need_right = not omit_space_after(text)
before, after = actions.user.dictation_peek(need_left, need_right)
Expand Down

0 comments on commit 027d7d0

Please sign in to comment.