MCPcopy Create free account
hub / github.com/JacquesLucke/code_autocomplete / get_text_to_line_end

Method get_text_to_line_end

graphics.py:153–162  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

151 return lines
152
153 def get_text_to_line_end(self, text):
154 index = 1
155 fitting_index = 0
156 while index > 0:
157 index = text.find(" ", index + 1)
158 if self.fits_in_line(text[:index]):
159 fitting_index = index
160 else:
161 return text[:fitting_index]
162 return text
163
164 def fits_in_line(self, text):
165 return self.get_text_width(text) <= self.width

Callers 1

get_wrapped_linesMethod · 0.95

Calls 1

fits_in_lineMethod · 0.95

Tested by

no test coverage detected