Skip to content

Block history #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ikanobori opened this issue Jul 4, 2014 · 12 comments
Open

Block history #22

ikanobori opened this issue Jul 4, 2014 · 12 comments
Labels

Comments

@ikanobori
Copy link
Contributor

eggy has suggested we have block history. I agree it's a good idea, but I just don't know how to do it without it sucking.

I think that what we're going to have to do is allow the user to move up and down within a block, which means things might get pretty complicated. Also would be a good idea to allow inserting a new line inside the block.

If anyone has any ideas how to do this cleanly please post comments here.


@ikanobori
Copy link
Contributor Author

bpython-curtsies has a "send-to-editor" key that somewhat substitutes for this - but it's the entire history, not just one block command.

demo


Original Comment By:

@ikanobori
Copy link
Contributor Author

For an example of this done well, see the Julia repl - I'm not a big fan of block history, but it treats it nicely. There is of course still the issue of hitting up and getting a block when you wanted a line, for which I guess we'd still need a block mode you could turn off.


Original Comment By:

@ikanobori
Copy link
Contributor Author

how about, browsing history normally and if history entry is multiline pressing enter would enter edit mode for that block, exiting from it can be normal exiting from multiline block or ctrl+enter


Original Comment By:

@ikanobori
Copy link
Contributor Author

Block history and block editing is the last thing needed to make me switch from ipython to bpython. Ipython's block editing is not great, but it is better than line-by-line history. It is tedious and ineffective to change a funciton or class by re-adding it line by line.


Original Comment By: David Fendrich

@ikanobori
Copy link
Contributor Author

Issue #111 was marked as a duplicate of this issue.


Original Comment By: Andreas Stührk

@ikanobori
Copy link
Contributor Author

I do not like this suggestion. In fact I do not like block history at all, but if we decide to do this we should need a shortcut to go into and out of block mode.


Original Comment By: Simon de Vlieger

@ikanobori
Copy link
Contributor Author

have a separate keypress for browsing up and down blocks.
ctrl-alt-p, ctrl-alt-n ?


Original Comment By: Anonymous

@thomasballinger
Copy link
Member

What about a separate "block browser" mode? View previous blocks, edit them in an external editor, then plunk one down? Otherwise the thing that makes the most sense to me is a separate key for block history - displaying the entries will be icky (should be entered into the buffer each time), but possible. Along with the new "edit current block" key (ctrl-x by default (yes this isn't a great keybinding)) being able to change the current buffer could be possible.

@thomasballinger
Copy link
Member

I'm once again excited about this, it would take some effort but I'm thinking about it now.

@rsalmei
Copy link

rsalmei commented Aug 11, 2016

Hello, please, are there any news in this regard?
I think bpython is great, but I'm really missing block editing. It is really important for some projects, where we need to modify classes and functions often. Line-by-line is a no go in all but a few pretty simple cases, with no more then 2 or 3 lines.
Please?

@thomasballinger
Copy link
Member

thomasballinger commented Aug 11, 2016

rsalmei, there aren't any immediate plans to implement this that I know of. I suggest the following workarounds:

  • ctrl-x opens the current block in a text editor
  • F7 opens the entire session in a text editor, then reruns on closing the text editor
  • a two-terminal workflow where you reload a module by pressing F6
  • with the optional dependency of watchdog installed, automatically reload modules when they change (F5 toggles this feature)

@pohmelie
Copy link

This is really good feature. Sometimes you have typo, sometimes you missed x = [] before appending in cycle, so block edit inside(!) bpython is must have, I think. Edit file and reload is boring, this does not differs from bpython -i tmp.py. Also, lack of this feature force me to use ugly one-liners, because I keep in mind, that I can have mistakes in code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants