| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3d3a663 commit 8a292ed
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,7 +52,7 @@ | |||
| 52 | 52 | import struct | |
| 53 | 53 | import sys | |
| 54 | 54 | import time | |
| 55 | - from typing import Iterator, NoReturn, List | ||
| 55 | + from typing import Iterator, NoReturn, List, MutableMapping, Any | ||
| 56 | 56 | import unicodedata | |
| 57 | 57 | from dataclasses import dataclass | |
| 58 | 58 | ||
@@ -66,7 +66,7 @@ | |||
| 66 | 66 | from pygments import format | |
| 67 | 67 | from pygments.formatters import TerminalFormatter | |
| 68 | 68 | from pygments.lexers import Python3Lexer | |
| 69 | - from pygments.token import Token | ||
| 69 | + from pygments.token import Token, _TokenType | ||
| 70 | 70 | from .formatter import BPythonFormatter | |
| 71 | 71 | ||
| 72 | 72 | # This for config | |
@@ -100,7 +100,9 @@ class ShowListState: | |||
| 100 | 100 | wl: int = 0 | |
| 101 | 101 | ||
| 102 | 102 | ||
| 103 | - def calculate_screen_lines(tokens, width, cursor=0) -> int: | ||
| 103 | + def calculate_screen_lines( | ||
| 104 | + tokens: MutableMapping[_TokenType, str], width: int, cursor: int = 0 | ||
| 105 | + ) -> int: | ||
| 104 | 106 | """Given a stream of tokens and a screen width plus an optional | |
| 105 | 107 | initial cursor position, return the amount of needed lines on the | |
| 106 | 108 | screen.""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments