Ticket #1710 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

newlines are lost when pasting multiline text

Reported by: slazav Owned by: andrew_b
Priority: major Milestone: 4.7.0
Component: mcedit Version: 4.7.0-pre3
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

Sometimes (on some terminal settings?) when pasting multiline text with shift+mouse newline characters are lost. Pasted text is not shown before any key is pressed.

This happens because editor do not handle shift- and control-enter keys.

In src/widget.c/input_callback() there is an explicit workaround:

/* When pasting multiline text, insert literal Enter */
if ((parm & ~KEY_M_MASK) == '\n') {

quote = 1;
v = handle_char (in, '\n');
quote = 0;
return v;

}

but mcedit use edit/editwidget.c/edit_callback() instead.

This problems can be fixed by adding similar code to edit_callback().

See commit 1269cfe65698ff0293a698849e9dcb1a6b12687d at
git://git.altlinux.org/people/slazav/packages/mc.git

Change History

comment:1 follow-up: ↓ 6 Changed 14 years ago by ossi

middle-mouse pasting in mc requires shift being pressed to keep mc from interpreting the button press itself, so it is passing on to xterm/gpm. that has the nice side effect that the pasted enter characters are automatically shift-enter, which was simply interpreted as newline-without-autoindent. however, the keybinding for shift-enter seems to have been lost in the course of #212 - it simply does nothing, and consequently text is pasted without newlines.

comment:2 Changed 14 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Milestone changed from 4.7 to 4.7.0

Created 1710_edit_instert_multiline branch. Parent branch is master.
changeset:3f19a0eeb94e0bb431d832bf8dedfcb172c4ccc2

comment:3 Changed 14 years ago by andrew_b

  • severity changed from no branch to on review

comment:4 Changed 14 years ago by andrew_b

  • Blocking 1720 added

comment:5 Changed 14 years ago by angel_il

  • Votes for changeset set to angel_il

comment:6 in reply to: ↑ 1 Changed 14 years ago by slazav

however, the keybinding for shift-enter seems to have been lost in the course of #212

Yes, all is OK if I use "EditReturn? = shift-enter" binding in the global keymap.

In addition pasting in "Return does autoindent" mode with this binding does not do unnecessary indents.

I think this binding solves the bug.

comment:7 Changed 14 years ago by vda

Guys, this is broken for at least 5 weeks now. Are there plans to make it works again anytime soonish?

In many projects there a policy that whoever committed a patch which added regressions, has to fix them, or risk his patch reverted...

comment:8 Changed 14 years ago by slavazanko

  • Votes for changeset changed from angel_il to angel_il slavazanko
  • severity changed from on review to approved

vda: sorry for inconvenience.

comment:9 Changed 14 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from angel_il slavazanko to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged
  • Blocking 1720 removed

comment:10 Changed 14 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.