MCPcopy Index your code
hub / github.com/python/cpython / _end_of_line

Method _end_of_line

Lib/curses/textpad.py:56–68  ·  view source on GitHub ↗

Go to the location of the first blank on the given line, returning the index of the last non-blank character.

(self, y)

Source from the content-addressed store, hash-verified

54 self.maxx = maxx - 1
55
56 def _end_of_line(self, y):
57 """Go to the location of the first blank on the given line,
58 returning the index of the last non-blank character."""
59 self._update_max_yx()
60 last = self.maxx
61 while True:
62 if curses.ascii.ascii(self.win.inch(y, last)) != curses.ascii.SP:
63 last = min(self.maxx, last+1)
64 break
65 elif last == 0:
66 break
67 last = last - 1
68 return last
69
70 def _insert_printable_char(self, ch):
71 self._update_max_yx()

Callers 2

do_commandMethod · 0.95
gatherMethod · 0.95

Calls 1

_update_max_yxMethod · 0.95

Tested by

no test coverage detected