[Idle-dev] [ idlefork-Patches-673428 ] An extension to add command-wise navigation to the shell

SourceForge.net noreply@sourceforge.net
Sat, 08 Feb 2003 15:51:58 -0800


Patches item #673428, was opened at 2003-01-24 00:24
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309579&aid=673428&group_id=9579

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Noam Raphael (noamr)
Assigned to: Nobody/Anonymous (nobody)
Summary: An extension to add command-wise navigation to the shell

Initial Comment:
This extension enables navigating in the shell window
according to
Python commands, using the Alt key.
Alt+Home goes to the beginning of the current command.
Alt+End goes to the end of the current command.
Alt+Up goes the the previous command.
Alt+Down goes to the next command.

This is, from my experience, useful for two things:
1. Many times, you want to recall a previous command. I
think it is easier to do so in the context of its
output and other commands, so instead of pressing
alt+p, which brings all commands but leaves them out of
context, you do alt+up to move quickly to the place
where you used the command, and then you click enter.
2. if you want to delete the entire command you typed,
especially if it contains multiple lines, you can now
type alt+shift+home, to move to the beginning of the
command while selecting the area, and press delete. I
don't know of an easy way to do this previously.

I wrote this as an extension, but I think the four
events should go directly to the PyShell class. I think
doing that is quite easy.

I don't see a way to attach two files, and I don't want
to bother you with another update, so you should add
the attached file to the directory of IDLEfork, and add
the following to config-extensions.def:

[CommandNavigator]
enable=1
[CommandNavigator_bindings]
beg_of_command=<Alt-Key-Home>
end_of_command=<Alt-Key-End>
prev_command=<Alt-Key-Up>
next_command=<Alt-Key-Down>


----------------------------------------------------------------------

>Comment By: Noam Raphael (noamr)
Date: 2003-02-09 01:51

Message:
Logged In: YES 
user_id=679426

I add context diff files for integrating the command-wise
navigation into PyShell, instead of being an extension.
I deleted the event beginning-of-line, which caused the
cursor to go to after the >>> instead of to the real
beginning of line, since now Alt-Home has the same
behaviour, so a special behaviour for the home key on the
first line of the command edited is unneccesary. Also, there
was a bug with this event - it didn't work when the Num Lock
key was on. It is fixed in the new Alt-Home event.

----------------------------------------------------------------------

Comment By: Noam Raphael (noamr)
Date: 2003-01-24 00:35

Message:
Logged In: YES 
user_id=679426

I'm sorry, from some reason the file wasn't uploaded

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309579&aid=673428&group_id=9579