Fix file permissions
This commit is contained in:
Executable → Regular
Executable → Regular
+5
@@ -1,6 +1,7 @@
|
||||
#ifndef EDITOR_H
|
||||
#define EDITOR_H
|
||||
|
||||
#include "editor/decl.h"
|
||||
#include "editor/hooks.h"
|
||||
#include "editor/indents.h"
|
||||
#include "editor/visual.h"
|
||||
@@ -101,6 +102,10 @@ struct Editor : Window {
|
||||
void lsp_handle(json msg);
|
||||
void apply_lsp_edits(std::vector<TextEdit> edits, bool move);
|
||||
|
||||
// Not used by core editor, but can be used by
|
||||
// extentions (due to cursor movement complexity)
|
||||
void format_full(int version);
|
||||
|
||||
Coord move_left(Coord cursor, uint32_t number);
|
||||
Coord move_right(Coord cursor, uint32_t number);
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+20
-10
@@ -1,10 +1,11 @@
|
||||
#ifndef EDITOR_COMPLETIONS_H
|
||||
#define EDITOR_COMPLETIONS_H
|
||||
#ifndef EXTENTION_COMPLETION_H
|
||||
#define EXTENTION_COMPLETION_H
|
||||
|
||||
#include "editor/decl.h"
|
||||
#include "io/sysio.h"
|
||||
#include "pch.h"
|
||||
#include "ui/completionbox.h"
|
||||
#include "ui/hover.h"
|
||||
#include "utils/utils.h"
|
||||
#include "windows/decl.h"
|
||||
|
||||
struct CompletionItem {
|
||||
std::string label;
|
||||
@@ -22,12 +23,19 @@ struct CompletionItem {
|
||||
std::vector<char> end_chars;
|
||||
};
|
||||
|
||||
struct CompletionBox : Popup {
|
||||
struct CompletionSession *session;
|
||||
CompletionBox() { this->hidden = true; }
|
||||
void render(std::vector<ScreenCell> &buffer, Coord size, Coord pos) override;
|
||||
void handle_click(KeyEvent, Coord) override { this->hidden = true; }
|
||||
~CompletionBox() {}
|
||||
};
|
||||
|
||||
struct CompletionSession {
|
||||
struct Editor *editor;
|
||||
std::shared_mutex mtx;
|
||||
bool active = false;
|
||||
Coord hook;
|
||||
std::optional<std::string> prefix;
|
||||
uint32_t select = 0;
|
||||
uint32_t scroll = 0;
|
||||
std::vector<CompletionItem> items;
|
||||
@@ -35,14 +43,12 @@ struct CompletionSession {
|
||||
bool complete = true;
|
||||
std::optional<char> trigger_char;
|
||||
uint8_t trigger = 0;
|
||||
CompletionBox box;
|
||||
HoverBox hover;
|
||||
CompletionBox *box = nullptr;
|
||||
uint32_t doc = UINT32_MAX;
|
||||
std::atomic<bool> hover_dirty = false;
|
||||
int version;
|
||||
|
||||
CompletionSession(Editor *editor) : editor(editor), box(this) {}
|
||||
|
||||
CompletionSession(Editor *editor) : editor(editor) {}
|
||||
void resolve_doc();
|
||||
void accept();
|
||||
void next();
|
||||
@@ -51,4 +57,8 @@ struct CompletionSession {
|
||||
void handle(KeyEvent event);
|
||||
};
|
||||
|
||||
#endif
|
||||
CompletionBox *init_completion_box(CompletionSession *session);
|
||||
void completion_request(Editor *editor);
|
||||
void completion_filter(Editor *editor);
|
||||
|
||||
#endif
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
@@ -1,21 +0,0 @@
|
||||
// #ifndef UI_COMPLETIONBOX_H
|
||||
// #define UI_COMPLETIONBOX_H
|
||||
//
|
||||
// #include "io/sysio.h"
|
||||
// #include "pch.h"
|
||||
// #include "utils/utils.h"
|
||||
//
|
||||
// struct CompletionBox {
|
||||
// std::shared_mutex mtx;
|
||||
// struct CompletionSession *session;
|
||||
// bool hidden = true;
|
||||
// std::vector<ScreenCell> cells;
|
||||
// Coord size;
|
||||
// Coord position;
|
||||
//
|
||||
// CompletionBox(CompletionSession *s) : session(s) {}
|
||||
// void render_update();
|
||||
// void render(Coord pos);
|
||||
// };
|
||||
//
|
||||
// #endif
|
||||
Executable → Regular
Executable → Regular
Reference in New Issue
Block a user