Displays dots in multiline prompt
(self, width, line_number, is_soft_wrap=False)
| 242 | return PygmentsTokens(toks) |
| 243 | |
| 244 | def continuation_tokens(self, width, line_number, is_soft_wrap=False): |
| 245 | """Displays dots in multiline prompt""" |
| 246 | if is_soft_wrap: |
| 247 | return "" |
| 248 | width = width - 1 |
| 249 | dots = builtins.__xonsh__.env.get("MULTILINE_PROMPT") |
| 250 | dots = dots() if callable(dots) else dots |
| 251 | if dots is None: |
| 252 | return [(Token, " " * (width + 1))] |
| 253 | basetoks = self.format_color(dots) |
| 254 | baselen = sum(len(t[1]) for t in basetoks) |
| 255 | if baselen == 0: |
| 256 | return [(Token, " " * (width + 1))] |
| 257 | toks = basetoks * (width // baselen) |
| 258 | n = width % baselen |
| 259 | count = 0 |
| 260 | for tok in basetoks: |
| 261 | slen = len(tok[1]) |
| 262 | newcount = slen + count |
| 263 | if slen == 0: |
| 264 | continue |
| 265 | elif newcount <= n: |
| 266 | toks.append(tok) |
| 267 | else: |
| 268 | toks.append((tok[0], tok[1][: n - count])) |
| 269 | count = newcount |
| 270 | if n <= count: |
| 271 | break |
| 272 | toks.append((Token, " ")) # final space |
| 273 | return PygmentsTokens(toks) |
| 274 | |
| 275 | def format_color(self, string, hide=False, force_string=False, **kwargs): |
| 276 | """Formats a color string using Pygments. This, therefore, returns |
nothing calls this directly
no test coverage detected