home · contact · privacy
Privatize PromptWidget.clear since it's no longer called elsewhere.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 3 Jun 2025 15:20:24 +0000 (17:20 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 3 Jun 2025 15:20:24 +0000 (17:20 +0200)
ircplom.py

index 09ebdc95e3b888e9e2e91ee6818c4b933974e608..267429565c11ae8bb2124f615d290605e13a2d6f 100755 (executable)
@@ -426,13 +426,13 @@ class PromptWidget(ScrollableWidget):
         if up and -(self._history_idx) < len(self._history):
             if self._history_idx == 0 and self._input_buffer:
                 self._history += [self._input_buffer[:]]
-                self.clear()
+                self._clear()
                 self._history_idx -= 1
             self._history_idx -= 1
         elif (not up) and self._history_idx < 0:
             self._history_idx += 1
             if self._history_idx == 0:
-                self.clear()
+                self._clear()
                 return
         else:
             return
@@ -445,7 +445,7 @@ class PromptWidget(ScrollableWidget):
         self._history_idx = 0
         self.draw()
 
-    def clear(self) -> None:
+    def _clear(self) -> None:
         'Empty current content.'
         self._input_buffer = ''
         self.draw()
@@ -455,7 +455,7 @@ class PromptWidget(ScrollableWidget):
         to_return = self._input_buffer[:]
         if to_return:
             self._history += [to_return]
-            self.clear()
+            self._clear()
             self.draw()
         return to_return