- commit
- d5c44d829916b78c3e267869f9ade18652b75952
- parent
- b46c7765a3521cfb523fcaabcb3909288c7ca5e7
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2025-06-06 12:42
consolidate on POST
Diffstat
M | python/pad/__init__.py | 7 | ++++--- |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/pad/__init__.py b/python/pad/__init__.py
@@ -79,6 +79,10 @@ class Pad: 79 79 print(e) 80 80 self.local_changes = [*self.staged_changes, *self.local_changes] 81 81 self.staged_changes = [] -1 82 return -1 83 -1 84 if r.json()['historyRemaining'] < 10: -1 85 self.consolidate() 82 86 83 87 def apply_changes(self, changes): 84 88 if vim.current.window.buffer == self.buffer: @@ -160,8 +164,5 @@ def on_channel(i, msg): 160 164 else: 161 165 pad.apply_changes(data[2]) 162 166 pad.reset_modified()163 -1164 -1 if (random.random() < 0.05):165 -1 pad.consolidate()166 167 elif msg.startswith('id: '): 167 168 pad.last_event_id = msg.split(': ', 1)[1]