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 107904 - code-editor line-wrap mode?
code-editor line-wrap mode?
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.2.x
Other Linux
: Normal enhancement
: future
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-03-09 03:08 UTC by joshg
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description joshg 2003-03-09 03:08:19 UTC
I have line-wrap enabled in gedit, and when I'm using the up or down keys
to move through my document, it should only hit each logical line once,
even if it is wrapped.

If this description is not clear, here's a way to see it nicely...
1) Open a document.
2) Turn on line numbering and line wrapping.
3) Find a line that's been wrapped, and move to the first character of the
logical line.
4) Notice that the line numbering has skipped over numbering the wrapped text.
5) Hit the down arrow. You are still on the same numbered line, though you
are in a different visible place. I would expect you to be on the next
numbered, logical line.

I've more or less adapted to expecting it to exhibit its current behavior
of hitting wrapped lines as many times as they are wrapped, but it's
particularly annoying when I'm, say, adjusting the tab indents over a range
of lines. Hitting down, left, and delete over and over can be done
relatively quickly, but I have to pause every line to check to make sure
I'm not deleting characters within a wrapped line.

I suppose a usability discussion is in order. I'll probably drop a note to
usability@

-jag
Comment 1 Paolo Maggi 2003-03-09 09:54:19 UTC
This is a GtkTextView problem.
Comment 3 Havoc Pennington 2003-03-09 16:52:09 UTC
When you realize that a line is a paragraph when editing 
normal paragraph-based human-readable text, it's obvious that the
current behavior is definitely correct in that case.
So the default for gedit should very clearly be the current 
behavior IMO, as gedit is supposed to in part be the "notepad" type of
app for GNOME.

Maybe the behavior should be different when editing source code, though.

Comment 4 joshg 2003-03-09 21:34:45 UTC
Excellent point, Havoc.

So what's the best way to get the widget to have flexible behavior? Or
is the solution to do as David Lazaro suggested
(http://mail.gnome.org/archives/usability/2003-March/msg00020.html)
and try to have the application include mass-editing functions when
editing code? It's obvious that the needs of a simple text widget and
a code editor widget conflict here.

-jag
Comment 5 Havoc Pennington 2003-03-09 22:12:10 UTC
Well, you can probably already rebind your arrow keys in gtkrc
to do paragraph-based logical rather than visual navigation; 
the text widget does have logical navigation already just not bound 
to the arrow keys.

Some programmatic way to do this would be nice, so an editor could do
it automatically in "C mode" vs. "text mode"
Comment 6 David Lazaro 2003-03-10 20:19:46 UTC
As indicated by Paolo Maggi in 
http://mail.gnome.org/archives/usability/2003-March/msg00022.html, 
gedit already has available the functionality I suggested in a plug-
in.  So maybe this bug can be marked as an enhancement.

This c-mode vs. text-mode idea intrigues me, though...  but I don't 
know if it would be appropriate for the 2.x time frame.
Comment 7 Owen Taylor 2003-06-05 14:06:03 UTC
IMO, code editors should simply add a horizontal scrollbar
when the line becomes too long ... having manual line
wrapping mixed together with automatic line wrapping is
extremely confusing.

I don't think anybody wants to work with automatically 
line wrapped code. Either you make your window wider or 
your reformat it barrow.

But leaving it open as a request-for-enhancement.
Comment 8 joshg 2003-06-05 17:54:40 UTC
Owen -

In many cases I can see how it would merely amplify confusion, but
some dedicated editors (e.g. Bluefish) have been doing this since GTK
1.x days... 

Perhaps this would be appropriate for the gtksourceview widget... I
don't know...

-jag
Comment 9 Owen Taylor 2003-06-05 18:27:31 UTC
This was a serious *bug* in the GTK+-1.2 text widget. I 
rejoiced the day we implemented the correct behavior
for GtkTextView.
Comment 10 joshg 2003-06-05 18:42:10 UTC
Owen -

No problem them... kindly ignore the RFE...

-jag