gh-124927: Fix conversion issue between coordinates and position in R… · python/cpython@6ab5c4a · GitHub
Skip to content

Commit 6ab5c4a

Browse files
authored
gh-124927: Fix conversion issue between coordinates and position in REPL (#125001)
1 parent a931a8b commit 6ab5c4a

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

Lib/_pyrepl/reader.py

Lines changed: 2 additions & 1 deletion

Lib/test/test_pyrepl/test_reader.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,11 @@ def test_pos2xy_with_no_columns(self):
319319
# Simulate a resize to 0 columns
320320
reader.screeninfo = []
321321
self.assertEqual(reader.pos2xy(), (0, 0))
322+
323+
def test_setpos_from_xy_for_non_printing_char(self):
324+
code = "# non \u200c printing character"
325+
events = code_to_events(code)
326+
327+
reader, _ = handle_all_events(events)
328+
reader.setpos_from_xy(8, 0)
329+
self.assertEqual(reader.pos, 7)

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ Laurent De Buyst
279279
Zach Byrne
280280
Vedran Čačić
281281
Nicolas Cadou
282+
Zhikai Cai
282283
Jp Calderone
283284
Ben Caller
284285
Arnaud Calmettes
Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)