Optimize the services implementation

Dont construct the selection string when we are merely checking if a
selection exists.
This commit is contained in:
Kovid Goyal
2023-02-01 12:44:49 +05:30
parent 1c6bae636b
commit 682428fb54
10 changed files with 55 additions and 9 deletions

View File

@@ -1354,6 +1354,9 @@ class Window:
lines = self.screen.text_for_selection(as_ansi, strip_trailing_spaces)
return ''.join(lines)
def has_selection(self) -> bool:
return self.screen.has_selection()
def call_watchers(self, which: Iterable[Watcher], data: Dict[str, Any]) -> None:
boss = get_boss()
for w in which: