-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.h
More file actions
31 lines (26 loc) · 1.04 KB
/
controller.h
File metadata and controls
31 lines (26 loc) · 1.04 KB
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
#pragma once
#include <stdbool.h>
#include "model.h"
#include "editor.h"
typedef struct {
bool is_insert;
int line;
int col;
char ch;
} Change;
typedef struct {
Change* changes;
int count;
int capacity;
} UndoStack;
extern UndoStack undo_stack;
extern UndoStack redo_stack;
void init_undo(void);
void push_undo(bool is_insert, int line, int col, char ch);
void push_redo(bool is_insert, int line, int col, char ch);
void undo_operation(Buffer* buf, int* cursor_line, int* cursor_col);
void redo_operation(Buffer* buf, int* cursor_line, int* cursor_col);
void clear_redo(void);
void free_undo(void);
void search_next(Buffer* buf, int* cursor_line, int* cursor_col, const char* pattern);
int handle_input(int ch, Buffer* buf, int* scroll_row, int* scroll_col, int* cursor_line, int* cursor_col, int* show_line_numbers, char* search_buffer, int* search_mode, char** clipboard, const char* filename, int* selection_start_line, int* selection_start_col, int* selection_end_line, int* selection_end_col, int* selection_active, Editor *ed);