When in overwrite mode, some actions still behave as in insert mode (will cause 
text to the right of the cursor to move right instead of staying in place and 
having part of it overwritten).  Furthermore, other actions that are 
"complementary" in insert mode are not in overwrite mode.
For example, I think it would make sense that pressing backspace in overwrite 
mode would "leave the characters in place" the same way adding text does when 
in that mode, so rather than simply deleting characters, they would be replaced 
with spaces.
Something similar would apply to cutting and pasting (which I found already 
reported in #763 and #716), and deleting selected text.

This behavior would be particularly convenient when editing **tables** that use 
space padding for alignment (e.g. in LaTeX or reStructuredText), or for ASCII 
art diagrams (which I often (~~ab~~)use for block diagrams and the like), which 
are actually the only cases where I've found overwrite mode useful (and quite 
convenient, in fact).  That way I could cut and paste or delete text without 
having to realign everything afterwards.  (In particular, being able to replace 
a whole segment of text with spaces with a single key press rather than 
pressing space many times can save a lot of time in this scenario.)

The behavior of the proposed "smart" overwrite mode would be:
- Typing:  overwrites text.
- Pressing tab:  overwrites with tab/spaces depending on setting, OR: simply 
moves the cursor forward to the next tab stop without overwriting text.
- Backspace:  deletes char at left, places space at right (*: except at end of 
line); moves cursor left.
- Delete:  deletes char at right, places space at left; moves cursor right.  
(Not too useful since typing space will already do that, but this behavior 
would mirror insert-mode Delete.)
- Select+backspace:  replaces selection with spaces (*); leaves cursor left of 
selection.
- Select+delete:  replaces selection with spaces; leaves cursor *right* of 
selection.
- Select+cut:  same effect as select+backspace.
- Paste (N characters):  overwrites N characters.
- Select+paste:  same effect as select+backspace followed by paste (overwrite, 
and if selection was longer than paste buffer, add spaces (*)).
- Ctrl+backspace/delete:  word deletion with same behavior as 
select+backspace/delete.
- Select+typing:  equivalent to select+backspace followed by typing (the 
current behavior is to delete the selected text AND overwrite the following 
text, which might be done by accident when you're too used to doing that in 
insert mode).
    - _Alternatively, select + typing a character could replace the whole 
selection with that character rather than space._
- Drag and drop text:  equivalent to cut+paste (TBD - maybe making this 
equivalent to the proposed behavior for cut+paste is not a good idea, since it 
is a destructive operation, and some may still want to use it e.g. to change 
the order of words in a sentence).

(Since this behavior would probably be unique to Geany, or at least I haven't 
seen it before, it should be implemented as an option, possibly disabled by 
default.)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3559
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/[email protected]>

Reply via email to