public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Patch: control-a -vs- horizontal scrollbar
@ 2000-04-08 14:21 Tom Tromey
  2000-04-10  9:45 ` James Ingham
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2000-04-08 14:21 UTC (permalink / raw)
  To: Insight List

Type a long line into the console window -- long enough to cause
horizontal scrolling.  Now use C-a or C-u to go to the start of the
line.  Notice that the cursor is not visible.

The appended patch fixes this.

For C-a and C-u we make the linestart visible, since this is the most
natural behavior.  For C-w we just make the insertion cursor visible
-- not the very best thing, but ok.

2000-04-08  Tom Tromey  <tromey@cygnus.com>

	* console.itb (Console::_build_win): Make Control-a, Control-u,
	and Control-w bindings show the insertion point.

Tom

Index: gdbtk/library/console.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 console.itb
--- console.itb	2000/02/07 00:19:42	1.1.1.1
+++ console.itb	2000/04/08 21:20:31
@@ -88,18 +88,21 @@
   # Control-a moves to start of line.
   bind_plain_key $_twin Control-a {
     %W mark set insert {cmdmark + 1 char}
+    %W see {insert linestart}
     break
   }
 
   # Control-u deletes to start of line.
   bind_plain_key $_twin Control-u {
     %W delete {cmdmark + 1 char} insert
+    %W see {insert linestart}
   }
   
   # Control-w deletes previous word.
   bind_plain_key $_twin Control-w {
     if {[%W compare {insert -1c wordstart} > cmdmark]} {
       %W delete {insert -1c wordstart} insert
+      %W see insert
     }
   }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: control-a -vs- horizontal scrollbar
  2000-04-08 14:21 Patch: control-a -vs- horizontal scrollbar Tom Tromey
@ 2000-04-10  9:45 ` James Ingham
  2000-04-10 10:11   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: James Ingham @ 2000-04-10  9:45 UTC (permalink / raw)
  To: tromey; +Cc: Insight List

Tom,

This looks good.  BTW, I put a preference in to wrap the console lines 
some time ago, but I haven't made it the default, because I wanted
some other people to see if it caused any oddities.  It works fine for 
me, but then it would...

You can turn it on by going into the console window & typing:

(gdb) tk pref set gdb/console/wrap 1

Have you been using this?  If not, could you give it a whirl, and if
you see nothing wrong with it, I will make "1" the default.

Thanks,

Jim

 > Type a long line into the console window -- long enough to cause
 > horizontal scrolling.  Now use C-a or C-u to go to the start of the
 > line.  Notice that the cursor is not visible.
 > 
 > The appended patch fixes this.
 > 
 > For C-a and C-u we make the linestart visible, since this is the most
 > natural behavior.  For C-w we just make the insertion cursor visible
 > -- not the very best thing, but ok.
 > 
 > 2000-04-08  Tom Tromey  <tromey@cygnus.com>
 > 
 > 	* console.itb (Console::_build_win): Make Control-a, Control-u,
 > 	and Control-w bindings show the insertion point.
 > 
 > Tom
 > 
 > Index: gdbtk/library/console.itb
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v
 > retrieving revision 1.1.1.1
 > diff -u -r1.1.1.1 console.itb
 > --- console.itb	2000/02/07 00:19:42	1.1.1.1
 > +++ console.itb	2000/04/08 21:20:31
 > @@ -88,18 +88,21 @@
 >    # Control-a moves to start of line.
 >    bind_plain_key $_twin Control-a {
 >      %W mark set insert {cmdmark + 1 char}
 > +    %W see {insert linestart}
 >      break
 >    }
 >  
 >    # Control-u deletes to start of line.
 >    bind_plain_key $_twin Control-u {
 >      %W delete {cmdmark + 1 char} insert
 > +    %W see {insert linestart}
 >    }
 >    
 >    # Control-w deletes previous word.
 >    bind_plain_key $_twin Control-w {
 >      if {[%W compare {insert -1c wordstart} > cmdmark]} {
 >        %W delete {insert -1c wordstart} insert
 > +      %W see insert
 >      }
 >    }
 >  
 > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: control-a -vs- horizontal scrollbar
  2000-04-10  9:45 ` James Ingham
@ 2000-04-10 10:11   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2000-04-10 10:11 UTC (permalink / raw)
  To: James Ingham; +Cc: tromey, Insight List

Jim> This looks good.

Can someone check it in?  I don't have cvs write access.

Jim> You can turn it on by going into the console window & typing:
Jim> (gdb) tk pref set gdb/console/wrap 1

Thanks, I'll give it a try.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-04-10 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-08 14:21 Patch: control-a -vs- horizontal scrollbar Tom Tromey
2000-04-10  9:45 ` James Ingham
2000-04-10 10:11   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).