After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 536916 - Pressing "Enter" in the middle of editing channel topic truncates it.
Pressing "Enter" in the middle of editing channel topic truncates it.
Status: RESOLVED FIXED
Product: xchat-gnome
Classification: Other
Component: general
HEAD
Other All
: Normal normal
: ---
Assigned To: xchat-gnome maintainers
xchat-gnome maintainers
Depends on:
Blocks: 602311
 
 
Reported: 2008-06-06 00:31 UTC by Jonathan Lange
Modified: 2010-03-24 13:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.73 KB, patch)
2009-05-10 01:11 UTC, Ritesh Khadgaray ( irc:ritz)
none Details | Review
patch (1.25 KB, patch)
2009-05-10 01:55 UTC, Ritesh Khadgaray ( irc:ritz)
rejected Details | Review
Don’t add \n to the string when pressing return (444 bytes, patch)
2009-06-13 12:34 UTC, Josselin Mouette
committed Details | Review

Description Jonathan Lange 2008-06-06 00:31:18 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:
Comment 1 Paul W. Frields 2009-02-10 12:23:39 UTC
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.


Comment 2 Ritesh Khadgaray ( irc:ritz) 2009-05-10 01:11:58 UTC
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.
Comment 3 Jonathan Lange 2009-05-10 01:47:14 UTC
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.
Comment 4 Ritesh Khadgaray ( irc:ritz) 2009-05-10 01:55:49 UTC
Created attachment 134343 [details] [review]
patch

makes sense, replaces "\n" with " ". This should allow the topic to be set correctly.
Comment 5 Ritesh Khadgaray ( irc:ritz) 2009-05-18 17:10:31 UTC
hmmm, the attached patch would break words. we need to remove "\n", and shift string by one char.
Comment 6 Josselin Mouette 2009-06-13 12:34:53 UTC
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.
Comment 7 Ritesh Khadgaray ( irc:ritz) 2009-06-18 09:44:30 UTC
thanks. committed - 
http://git.gnome.org/cgit/xchat-gnome/commit/?id=6d1a939a14de918de4a79c010d82796f8035bcfa