Commit 0465d8e
committed
Fix SPC insertion being affected by previous prefix argument
After mazegaki conversion has been used once, inserting a space
character (SPC) becomes affected by the prefix argument of the
previous command, rather than the current one.
When mazegaki conversion is used for the first time, `tc-mazegaki.el`
adds a binding for SPC to `tcode-mode-map`. Thereafter, typing SPC is
handled by `tcode-input-method`, which executes the command
`tcode-mazegaki-space-or-convert` with the value of
`current-prefix-arg` as its prefix argument.
This issue occurs when `tcode-use-input-method` is non-`nil`.
Changing this variable affects when `tcode-input-method` is invoked.
When the value is `nil`, the function is called from
`tcode-self-insert-command`, at which point `current-prefix-arg`
correctly represents the prefix argument for
`tcode-self-insert-command`, so it is appropriate to pass it along to
the subcommand. However, when `tcode-use-input-method` is non-`nil`,
`tcode-input-method` is invoked directly from the event loop, at a
time when no command is currently executing. In that case,
`current-prefix-arg` still holds the prefix argument from the previous
command, so using it for the subcommand is incorrect. Use
`prefix-argument` instead when `tcode-use-input-method` is non-`nil`.1 parent a67b2d9 commit 0465d8e
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
666 | | - | |
667 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
668 | 669 | | |
669 | 670 | | |
670 | 671 | | |
| |||
0 commit comments