GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Incorrect undo behavior following a code block · Issue #826 · bpython/bpython

Incorrect undo behavior following a code block #826

New issue
Copy link
New issue
Copy link
Open
Open
Incorrect undo behavior following a code block#826
Copy link
Labels
bug

Description

@rybarczykj
rybarczykj
opened on Jul 17, 2020
Issue body actions

If i type this into bpython:
>>> for i in range(10):
... print(i)
And then do a rewind/undo after it prints the numbers 0-9, it removes only the 9. Pressing undo again undoes the rest.

I'm pretty sure this is due to the trailing blank lines in the buffer. So in curtsiesfrontend/repl.py, prompt_undo() sees the last input line as blank (self.history) even though the last output line (self.display_lines) is not blank. So it calls take_back_empty_line().

The trailing blank lines are definitely nice, so I think the goal behavior here is to undo the print and take you back to the buffer.

I might be able to fix this with the PR I'm working on right now, but I'm not exactly sure how yet, so I wanted to document it.

Activity

  1. thomasballinger commented on Jul 18, 2020

    @thomasballinger
    thomasballinger
    on Jul 18, 2020
    Member
    More actions

    Oh nice find

  2. sebastinas
    added
    bug
    on Nov 13, 2020
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.