Ticket #2233 (closed defect: duplicate)
Pasting into editor does incremental indentation (regression)
Reported by: | alex_sh | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 4.7 |
Component: | mcedit | Version: | version not selected |
Keywords: | paste indent mcedit | Cc: | |
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: |
Description
I've encountered this bug in 4.7.2 and 4.7.3 (4.6.2.pre1 worked properly):
Consider that I have a text with some lines starting with spaces or tabs. When I paste it into mc (using shift-middle-click or shift-insert), mc thinks they're manual indentations, so it indents every line even further.
For example, pasting the following:
PID TTY TIME CMD
2 ? 00:00:00 kthreadd
3 ? 00:00:00 \_ migration/0
4 ? 00:00:00 \_ ksoftirqd/0
5 ? 00:00:00 \_ watchdog/0
6 ? 00:00:00 \_ migration/1
is actually pasted as:
PID TTY TIME CMD
2 ? 00:00:00 kthreadd
3 ? 00:00:00 \_ migration/0
4 ? 00:00:00 \_ ksoftirqd/0
5 ? 00:00:00 \_ watchdog/0
6 ? 00:00:00 \_ migration/1
Note that this only happens in X11 (I tried using xterm, konsole and xfce-Terminal). It appears to paste as intended in the text-mode.
Also, I just checked 4.6.2.pre1 and it behaves properly, so this is a regression.
Change History
comment:2 in reply to: ↑ 1 Changed 14 years ago by alex_sh
Replying to zaytsev:
Disable Return does autoindent in editor preferences.
Except this also disables the "Return Does Autoindent" functionality (which I need).
Keep in mind that with "Return Does Autoindent" on, 4.6.2.pre1 works correctly (both in text-mode and X11), mc-4.7.3 in text-mode works correctly, mc-4.7.3 in X11 doesn't.
I remember reading something about the fact that mc automatically disables "Return Does Autoindent" while shift is pressed. I guess that detection in X11 just broke somewhere along the line.
Disable Return does autoindent in editor preferences.