Skip to content

Block history #22

Open
Open

Description

@ikanobori

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.


Activity

  1. ikanobori commented on Jul 4, 2014

    @ikanobori
    ContributorAuthor

    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:

  2. ikanobori commented on Jul 4, 2014

    @ikanobori
    ContributorAuthor

    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:

  3. ikanobori commented on Jul 4, 2014

    @ikanobori
    ContributorAuthor

    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:

  4. ikanobori commented on Jul 4, 2014

    @ikanobori
    ContributorAuthor

    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

  5. ikanobori commented on Jul 4, 2014

    @ikanobori
    ContributorAuthor

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


    Original Comment By: Andreas Stührk

  6. ikanobori commented on Jul 4, 2014

    @ikanobori
    ContributorAuthor

    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

  7. ikanobori commented on Jul 4, 2014

    @ikanobori
    ContributorAuthor

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


    Original Comment By: Anonymous

  8. thomasballinger commented on Aug 10, 2014

    @thomasballinger
    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.

  9. thomasballinger commented on Jan 25, 2015

    @thomasballinger
    Member

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

  10. rsalmei commented on Aug 11, 2016

    @rsalmei

    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?

  11. thomasballinger commented on Aug 11, 2016

    @thomasballinger
    Member

    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)
  12. pohmelie commented on Aug 24, 2017

    @pohmelie

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions