convert_selection

Function convert_selection 

Source
fn convert_selection(_: ())
Expand description

Converts the current visual selection using a user-chosen conversion option.

Prompts the user (via [ytil_noxi::vim_ui_select::open]) to select a conversion option, then applies the conversion to the selected text in place.

Returns early if:

  • No active Visual selection is detected.
  • The user cancels the prompt.
  • The conversion fails (an error is reported via [ytil_noxi::notify::error]).
  • Writing the converted text back to the buffer fails (an error is reported via [ytil_noxi::notify::error]).

§Errors

Errors from [ytil_noxi::vim_ui_select::open] are reported via [ytil_noxi::notify::error] using the direct display representation of color_eyre::Report. Conversion errors are also reported similarly.

§Notes

Currently supports single-line selections; multiline could be added later.