working for starting screen
This commit is contained in:
+7
-8
@@ -209,8 +209,10 @@ int executeKeyBind(char *key_sequence) {
|
||||
void editorProcessKeypress() {
|
||||
int c = editorReadKey();
|
||||
char key_sequence[8];
|
||||
EditorPane *active = splitScreenGetActivePane();
|
||||
struct buffer_t *buf = bufferFindById(active->buffer_id);
|
||||
|
||||
if (E.constantes.LSP) {
|
||||
if (E.constantes.LSP && buf->b_lsp_open) {
|
||||
if (c == LSP_WAKE_KEY)
|
||||
return;
|
||||
if (E.lsp_client && E.lsp_completion.visible) {
|
||||
@@ -227,8 +229,7 @@ void editorProcessKeypress() {
|
||||
if (c == '\r') {
|
||||
CompletionItem *item =
|
||||
&E.lsp_completion.items[E.lsp_completion.selected];
|
||||
EditorPane *active = splitScreenGetActivePane();
|
||||
struct buffer_t *buf = bufferFindById(active->buffer_id);
|
||||
|
||||
|
||||
// Find how many chars the user already typed by looking at the
|
||||
// current word (chars before cursor on the same line)
|
||||
@@ -267,16 +268,14 @@ void editorProcessKeypress() {
|
||||
int seq_len = utf8Encode(c, key_sequence);
|
||||
appDebug("key seq : %s\n", key_sequence);
|
||||
bufferInsertBytes(key_sequence, seq_len);
|
||||
if (E.constantes.LSP && is_word_char(key_sequence)) {
|
||||
EditorPane *active = splitScreenGetActivePane();
|
||||
struct buffer_t *buffer = bufferFindById(active->buffer_id);
|
||||
if (buf->b_lsp_open && is_word_char(key_sequence)) {
|
||||
|
||||
if (E.lsp_client && E.lsp_client->state == LSP_READY) {
|
||||
lspDidChange(E.lsp_client, buffer);
|
||||
lspDidChange(E.lsp_client, buf);
|
||||
|
||||
E.lsp_client->completion_just_arrived = 0; // consume the flag
|
||||
}
|
||||
buffer->b_has_changed = 0;
|
||||
buf->b_has_changed = 0;
|
||||
editorAutoComplete(lisp_null(), &E.ctx_error, E.ctx);
|
||||
}
|
||||
E.quit_times_buffer = E.constantes.QUIT_TIMES;
|
||||
|
||||
Reference in New Issue
Block a user