Commit 4e6ef86
committed
seek-to: Refactor
Simplify seek state handling by introducing a global `seek_mode`
variable instead of juggling three separate booleans. This ensures that
only one mode is active at a time and reduces redundant checks.
To be more detailed, `seek_mode` acts as the single source of truth.
Only one state can be assigned to it at a time, or none. The prefix
code logic is also changed to use inline table lookup, which looks
cleaner and more readable.toggle_seek_mode()
1 parent 5c55f2d commit 4e6ef86
1 file changed
+7
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | | - | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
175 | 171 | | |
176 | 172 | | |
177 | 173 | | |
| |||
0 commit comments