helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
32.93k stars 2.43k forks source link

sequences of commands interact poorly with interactive commands in mappings #11482

Open jyn514 opened 1 month ago

jyn514 commented 1 month ago

Summary

i tried the following config:

[keys.normal]
"g" = { "q" = ["select_textobject_inner", ":reflow"] }

i expect that this allows me to type gqp to reflow a paragraph. instead, it reflows the current selection, and then pops up a "Match inside" dialogue that changes, but does not reflow, the selection.

Reproduction Steps

I tried this: 1. `hx helix-term/src/commands/engine/components.rs:387` 2. `xxx` 3. `gqp` I expected this to happen: `gqp` reflows the macro call. Instead, this happened: it reflows the 3 selected lines. https://asciinema.org/a/qwFuppLrNvUG3vxDx0LuQwB2x ### Helix log nothing relevant ### Platform linux ### Terminal Emulator tmux next-3.5, embedded in kitty 0.35.1, with TERM=tmux-256color ### Installation Method built from source ### Helix Version helix 24.7 (a632904d)
glfmn commented 2 days ago

Also, it would be really useful to be able to to select_textobject_{around,inside}_paragraph directly as a command rather than it only having the interactive version; this would be useful to integrate things like tidalcycles as one could do this:

[keys.normal.T]
ret = ["select_textobject_around_paragraph", ":pipe-to ~/tidal_send.sh"]