GNOME Bugzilla – Bug 536916
Pressing "Enter" in the middle of editing channel topic truncates it.
Last modified: 2010-03-24 13:05:01 UTC
Please describe the problem: When you edit a channel topic using the change topic dialog, change something in the middle of the topic and then hit "enter" the topic will be truncated at the position of the cursor. This is a particularly annoying bug because it loses text that had been entered & edited previously without an easy way of undoing the action. Steps to reproduce: 1. Join an IRC channel. 2. Press "Alt-T" to edit the topic. 3. Change a word in the middle of the topic 4. Press <Enter> or <Return> on the keyboard. Actual results: The new topic will be truncated to the position of the cursor in the dialog box. Expected results: The topic should be the entire text in the dialog box. Does this happen every time? Yes. Other information:
This bug continues in xchat-gnome 0.24. See also: https://bugzilla.redhat.com/show_bug.cgi?id=483839 ...which shows the bug in Fedora 10, xchat-gnome-0.24.1-1.fc10.x86_64.
Created attachment 134339 [details] [review] patch check if we are at the end of the line, before we accept "enter" key. additionally, as topic cannot be multi-line, replace them with space.
I think the right thing to do here is to accept the "enter" key no matter when it's pressed, and treat that the same as hitting the "Change" button -- i.e. what xchat-gnome does now. The only thing that needs to change is that the whole contents of the textarea need to be used, not just everything up to the "enter" key.
Created attachment 134343 [details] [review] patch makes sense, replaces "\n" with " ". This should allow the topic to be set correctly.
hmmm, the attached patch would break words. we need to remove "\n", and shift string by one char.
Created attachment 136498 [details] [review] Don’t add \n to the string when pressing return Ugh, the proposed patch is ugly. All you need is to stop the signal so that the default handler is not executed.
thanks. committed - http://git.gnome.org/cgit/xchat-gnome/commit/?id=6d1a939a14de918de4a79c010d82796f8035bcfa