Title: Incorrect undo behavior following a code block · Issue #826 · bpython/bpython · GitHub
Open Graph Title: Incorrect undo behavior following a code block · Issue #826 · bpython/bpython
X Title: Incorrect undo behavior following a code block · Issue #826 · bpython/bpython
Description: 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 li...
Open Graph Description: 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 s...
X Description: 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...
Opengraph URL: https://github.com/bpython/bpython/issues/826
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect undo behavior following a code block","articleBody":"If i type this into bpython:\r\n`>>> for i in range(10):`\r\n` ... print(i)`\r\nAnd then do a rewind/undo after it prints the numbers 0-9, it removes only the 9. Pressing undo _again_ undoes the rest.\r\n\r\nI'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()`.\r\n\r\nThe 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.\r\n\r\nI 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.","author":{"url":"https://github.com/rybarczykj","@type":"Person","name":"rybarczykj"},"datePublished":"2020-07-17T18:21:55Z","url":"https://github.com/bpython/bpython/issues/826"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8dd6c747-45c1-27e9-4b63-f2ade9621bec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9436:23E48:1D4B87:25099F:6B0202CD |
| html-safe-nonce | c7cf5d1cba73114465801b5389ac841ce1fca2b9db8975d1f609bea93701c1cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDM2OjIzRTQ4OjFENEI4NzoyNTA5OUY6NkIwMjAyQ0QiLCJ2aXNpdG9yX2lkIjoiNDgxMTM3NzYyNTU0NzI3NzAwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1ebba37a53a8a008c33dc3159fb4c2068ebc0b2d901264cec304305c0747d1a4 |
| hovercard-subject-tag | issue:659502384 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bpython/bpython/826/issue_layout |
| twitter:image | https://opengraph.githubassets.com/630486c0eeb7d52778fb8257efc043ae2d800476f5ea6e2b2e0a25ef34c04128/bpython/bpython/issues/826 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/630486c0eeb7d52778fb8257efc043ae2d800476f5ea6e2b2e0a25ef34c04128/bpython/bpython/issues/826 |
| og:image:alt | 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 s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rybarczykj |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/bpython/bpython git https://github.com/bpython/bpython.git |
| octolytics-dimension-user_id | 8071396 |
| octolytics-dimension-user_login | bpython |
| octolytics-dimension-repository_id | 21508865 |
| octolytics-dimension-repository_nwo | bpython/bpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21508865 |
| octolytics-dimension-repository_network_root_nwo | bpython/bpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width