summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-20 21:54:52 -0500
committerpommicket <pommicket@gmail.com>2022-12-20 21:54:52 -0500
commit7568add9317f2bad5f633e5c587c76b87175899f (patch)
treef758573c4f3fdd6ecb7ebde4fb17314b51ad3b2f /ted.h
parent885df8890e537383df71f8f828444d6c5cce0243 (diff)
autocomplete very broken but kinda working
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/ted.h b/ted.h
index 77e3c51..2bc7d43 100644
--- a/ted.h
+++ b/ted.h
@@ -353,12 +353,21 @@ typedef struct {
} BuildError;
typedef struct {
- bool visible; // updated every frame depending on word at cursor + filter
char *label;
char *filter;
char *text;
} Autocompletion;
+typedef struct {
+ bool open; // is the autocomplete window open?
+
+ Autocompletion *completions; // dynamic array of all completions
+ u32 *suggested; // dynamic array of completions to be suggested (indices into completions)
+ BufferPos last_pos; // position of cursor last time completions were generated. if this changes, we need to recompute completions.
+ i32 cursor; // which completion is currently selected (index into suggested)
+ Rect rect; // rectangle where the autocomplete menu is (needed to avoid interpreting autocomplete clicks as other clicks)
+} Autocomplete;
+
typedef struct Ted {
struct LSP *test_lsp; // @TODO: something better
@@ -410,12 +419,7 @@ typedef struct Ted {
Command warn_unsaved; // if non-zero, the user is trying to execute this command, but there are unsaved changes
bool build_shown; // are we showing the build output?
bool building; // is the build process running?
- bool autocomplete; // is the autocomplete window open?
-
- Autocompletion *autocompletions; // dynamic array of suggestions
- BufferPos autocomplete_pos; // position of cursor last time completions were generated. if this changes, we need to recompute completions.
- i32 autocomplete_cursor; // which completion is currently selected
- Rect autocomplete_rect; // rectangle where the autocomplete menu is (needed to avoid interpreting autocomplete clicks as other clicks)
+ Autocomplete autocomplete;
FILE *log;