-
Notifications
You must be signed in to change notification settings - Fork 105
Commit 424453d
authored
Suggestion Window Fixes (#350)
### Description
Generally improves a few UX bugs with the suggestion window.
Specifically the window would flash often even if the controller did not
re-request new items, and would sometimes move the window when it
shouldn't have. Also adjusts the window's x position to align the
completion labels with the text.
- Centralizes suggestion presentation logic into a single class.
- Moves the trigger character logic out of a filter and into a textview
delegate-like method that checks if the last typed character was a
trigger character.
- Ensures the textview and cursor positions are up-to-date when the
notification is sent.
- Helps remove duplicate cursor update notifications sent to the
suggestion controller by checking if an update is a duplicate in the
centralized logic controller.
- Adjusts the suggestion window's x position to align the text in the
completion labels with the text being typed.
Also includes a few changes fixing some build warnings.
### Related Issues
* #282
### Checklist
- [x] I read and understood the [contributing
guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md)
as well as the [code of
conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code
### Screenshots
https://github.com/user-attachments/assets/14662210-0c15-422d-8dea-a5ae55b5d836 1 parent ee0c00a commit 424453d
File tree
14 files changed
+118
-63
lines changed- Example/CodeEditSourceEditorExample
- CodeEditSourceEditorExample/Views
- Sources/CodeEditSourceEditor
- CodeSuggestion
- Model
- TableView
- Window
- Controller
- Filters
- TreeSitter
14 files changed
+118
-63
lines changedLines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 | + | ||
49 | + | ||
48 | 50 |
| |
49 | 51 |
| |
50 | 52 |
| |
53 | + | ||
51 | 54 |
| |
52 | 55 |
| |
53 | 56 |
| |
| |||
89 | 92 |
| |
90 | 93 |
| |
91 | 94 |
| |
95 | + | ||
92 | 96 |
| |
93 | 97 |
| |
94 | 98 |
| |
95 | 99 |
| |
96 | 100 |
| |
97 | 101 |
| |
98 | 102 |
| |
103 | + | ||
104 | + | ||
105 | + | ||
106 | + | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
99 | 111 |
| |
100 | 112 |
| |
101 | 113 |
| |
102 | 114 |
| |
103 | 115 |
| |
104 | 116 |
| |
117 | + | ||
118 | + | ||
119 | + | ||
120 | + | ||
105 | 121 |
| |
106 | 122 |
| |
107 | 123 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 | - | ||
18 | + | ||
19 | + | ||
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
24 | - | ||
25 | + | ||
26 | + | ||
27 | + | ||
25 | 28 |
| |
26 | 29 |
| |
27 | 30 |
| |
|
Lines changed: 70 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 | + | ||
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 | + | ||
13 | + | ||
12 | 14 |
| |
13 | 15 |
| |
14 | 16 |
| |
| |||
45 | 47 |
| |
46 | 48 |
| |
47 | 49 |
| |
48 | - | ||
50 | + | ||
49 | 51 |
| |
50 | 52 |
| |
51 | 53 |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 | - | ||
12 | + | ||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 | - | ||
21 | + | ||
22 | + | ||
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
94 | - | ||
94 | + | ||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
85 | - | ||
86 | - | ||
85 | + | ||
86 | + | ||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
99 | - | ||
99 | + | ||
100 | 100 |
| |
101 | 101 |
| |
102 | 102 |
| |
|
Lines changed: 0 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 | - | ||
28 | 27 |
| |
29 | 28 |
| |
30 | 29 |
| |
| |||
121 | 120 |
| |
122 | 121 |
| |
123 | 122 |
| |
124 | - | ||
125 | - | ||
126 | - | ||
127 | - | ||
128 | - | ||
129 | - | ||
130 | - | ||
131 | - | ||
132 | - | ||
133 | - | ||
134 | - | ||
135 | - | ||
136 | - | ||
137 | - | ||
138 | - | ||
139 | - | ||
140 | - | ||
141 | - | ||
142 | - | ||
143 | - | ||
144 | 123 |
|
0 commit comments