Sublime Forum

Insert Mode Editing and Paired Characters

#1

When editing in insert mode, the use of pair-matched characters like quotes, brackets, etc., behaves in non-insert mode — i.e. the matching character shifts right the text, as in normal editing, thus breaking the text alignment which one is (usually) attempting to preserve by insert mode.

This kind of defeats the whole purpose of insert mode editing, and requires manually deleting the extra characters to preseve alignment. In multi-cursor editing this can introduce even more problems.

Is this something that could be fixed globally in ST?

Ideally, it would also be nice to be able to insert-paste when pasting in insert-mode, but this might be more complicated than the above.

0 Likes

#2

presumably you’d just need to change all keybindings that check setting.auto_match_enabled to also check overwrite_status, or have an event listener that will turn off auto_match_enabled for the view when the toggle_overwrite command is executed.

0 Likes

#3

Thanks! I’ll look into that and post the solution if I get it working.

But I think that, this being a general editing feature, it should be addressed natively in ST. I’d expect that if a user is using insert mode is because he desires to preserve alignments in the remainder of the line(s), and it would make sense that ST natively honours the insert modality.

After all, this affects the whole application, regardless of packages and syntaxes, and ideally the solution should be hard-coded into ST in order to work across any package or syntax.

0 Likes