Commit 1ff0bb3
authored
refactor!: move source/sticky logic to chat window (#1469)
This refactors the management of source and sticky prompt logic by moving
it from the main module to the chat window implementation. The
`CopilotChat.source` and sticky state are now encapsulated within the
`CopilotChat.ui.chat.Chat` class, providing a cleaner separation of
concerns and reducing global state. All related methods and type
annotations have been updated accordingly. The sticky prompt insertion
and retrieval logic is now handled via `get_sticky` and `set_sticky`
methods on the chat window, and the source window/buffer is managed
through `get_source` and `set_source` methods. This change also removes
the sticky toggle mapping and updates documentation and function
signatures for consistency.
BREAKING CHANGE: get_source, and set_source methods moved to require('CopilotChat').chat1 parent 4d92564 commit 1ff0bb3
File tree
9 files changed
+111
-193
lines changed- lua/CopilotChat
- config
- ui
9 files changed
+111
-193
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | 411 | | |
416 | 412 | | |
417 | 413 | | |
| |||
441 | 437 | | |
442 | 438 | | |
443 | 439 | | |
444 | | - | |
445 | 440 | | |
446 | 441 | | |
447 | 442 | | |
448 | 443 | | |
449 | 444 | | |
450 | 445 | | |
451 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
452 | 451 | | |
453 | 452 | | |
454 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 105 | | |
138 | 106 | | |
139 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
0 commit comments