Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132267: fix desynchronized cursor position and buffer mismatch after resize#132360

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ImFeH2 wants to merge6 commits intopython:main
base:main
Choose a base branch
Loading
fromImFeH2:gh-132267
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
fix: align oldscr when refresh
  • Loading branch information
@ImFeH2
ImFeH2 committedMay 20, 2025
commit047ffff5a2919e95360a2637b01fb2a2bc2f7832
3 changes: 3 additions & 0 deletionsLib/_pyrepl/windows_console.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -216,6 +216,9 @@ def refresh(self, screen: list[str], c_xy: tuple[int, int]) -> None:
oldscr = self.screen[old_offset : old_offset + height]
newscr = screen[offset : offset + height]

if len(oldscr) < height:
oldscr += [""] * (height - len(oldscr))

self.__offset = offset

self._hide_cursor()
Expand Down
19 changes: 11 additions & 8 deletionsLib/test/test_pyrepl/test_windows_console.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,7 @@
MOVE_UP,
MOVE_DOWN,
ERASE_IN_LINE,
CLEAR,
)
import _pyrepl.windows_console as wc
except ImportError:
Expand DownExpand Up@@ -117,9 +118,8 @@ def same_console(events):
prepare_console=same_console,
)

con.out.write.assert_any_call(self.move_right(2))
con.out.write.assert_any_call(self.move_up(2))
con.out.write.assert_any_call(b"567890")
con.out.write.assert_any_call(self.clear())
con.out.write.assert_any_call(b"1234567890")

con.restore()

Expand DownExpand Up@@ -280,11 +280,13 @@ def same_console(events):
)
con.out.write.assert_has_calls(
[
call(self.move_left(5)),
call(self.clear()),
call(b"\n"),
call(self.move_up()),
call(b"def f():"),
call(self.move_left(3)),
call(self.move_left(8)),
call(self.move_down()),
call(b" foo")
]
)
console.restore()
Expand DownExpand Up@@ -318,9 +320,7 @@ def same_console(events):
)
con.out.write.assert_has_calls(
[
call(self.move_left(5)),
call(self.move_up()),
call(self.erase_in_line()),
call(self.clear()),
call(b" foo"),
]
)
Expand All@@ -342,6 +342,9 @@ def move_right(self, cols=1):
def erase_in_line(self):
return ERASE_IN_LINE.encode("utf8")

def clear(self):
return CLEAR.encode("utf8")

def test_multiline_ctrl_z(self):
# see gh-126332
code = "abcdefghi"
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp