summaryrefslogtreecommitdiff
path: root/poezio/windows/inputs.py
diff options
context:
space:
mode:
Diffstat (limited to 'poezio/windows/inputs.py')
-rw-r--r--poezio/windows/inputs.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/poezio/windows/inputs.py b/poezio/windows/inputs.py
index 7ee8aa45..01b94ac0 100644
--- a/poezio/windows/inputs.py
+++ b/poezio/windows/inputs.py
@@ -5,7 +5,7 @@ Text inputs.
import curses
import logging
import string
-from typing import List, Dict, Callable, Optional
+from typing import List, Dict, Callable, Optional, ClassVar
from poezio import keyboard
from poezio import common
@@ -592,9 +592,10 @@ class HistoryInput(Input):
An input with colors and stuff, plus an history
^R allows to search inside the history (as in a shell)
"""
- __slots__ = ('help_message', 'histo_pos', 'current_completed', 'search')
+ __slots__ = ('help_message', 'histo_pos', 'current_completed', 'search',
+ 'history')
- history: List[str] = []
+ global_history: ClassVar[List[str]] = []
def __init__(self) -> None:
Input.__init__(self)
@@ -604,8 +605,9 @@ class HistoryInput(Input):
self.key_func['^R'] = self.toggle_search
self.search = False
if config.getbool('separate_history'):
- # pylint: disable=assigning-non-slot
self.history: List[str] = []
+ else:
+ self.history = self.__class__.global_history
def toggle_search(self) -> None:
if self.help_message:
@@ -682,7 +684,7 @@ class MessageInput(HistoryInput):
Also letting the user enter colors or other text markups
"""
# The history is common to all MessageInput
- history: List[str] = []
+ global_history: ClassVar[List[str]] = []
def __init__(self) -> None:
HistoryInput.__init__(self)
@@ -728,7 +730,7 @@ class CommandInput(HistoryInput):
HelpMessage when a command is started
The on_input callback
"""
- history: List[str] = []
+ global_history: ClassVar[List[str]] = []
def __init__(self, help_message: str, on_abort, on_success, on_input=None) -> None:
HistoryInput.__init__(self)