Meta plugin can't cancel out last_action next_case effect #1443
user202729
started this conversation in
Technical Discussion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I write
can
can
can
{:case:upper_first_word}
can
{:retro_stringop:3:__import__('re').sub(r"\s*(\w+|.)$", r"(\1)", text)}
I get
can CAN can(CAN)
instead of the expectedcan can can(CAN)
.This is because the meta plugin returns the new_action that replaces
can can can
withcan can(CAN)
, but the previousupper_carry
makes the uppercase.Reading
plover/plover/formatting.py
Line 819 in 4394ef1
_Action
per atom ("meta plugin call").On the user side, it's always possible to define the translation as
{}{<the meta>}
to avoid the change; however is it possible for the meta to provide the mechanism by itself?I can think of some ways to fix the issue
(current workaround, bad)
Change the meta so that
prev_replace
always start with a space. (Occasionally not possible, for example when there's no undo history)(I think this is the best solution, but extremely backwards incompatible. Alternatively just allow it to output either a single
_Action
object, or a list of_Action
objects)Allow a meta plugin to output a list of
_Action
objects.(acceptable, but more special cases)
Add another entry/enum item for
Case
:cancel_prev_case
to cancel the previousnext_case
effect.Beta Was this translation helpful? Give feedback.
All reactions