temp commit
This commit is contained in:
@@ -55,4 +55,6 @@ int bufferSave(void);
|
||||
*/
|
||||
int bufferSaveAll(void);
|
||||
|
||||
void bufferFind(struct buffer_t *buf);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,6 @@ Lisp l_editorInsertNewLine(Lisp args, LispError* e, LispContext ctx);
|
||||
Lisp l_editorInserTab(Lisp args, LispError *e, LispContext ctx);
|
||||
Lisp deletePreviousChar(Lisp args, LispError *e, LispContext ctx);
|
||||
Lisp editorPrintC(Lisp args, LispError *e, LispContext ctx);
|
||||
Lisp editorDelRow_L(Lisp args, LispError *e, LispContext ctx);
|
||||
Lisp editorReadChar_L(Lisp args, LispError *e, LispContext ctx);
|
||||
|
||||
// Editor
|
||||
|
||||
+9
-17
@@ -33,15 +33,12 @@ typedef enum {
|
||||
*/
|
||||
typedef struct {
|
||||
int buffer_id; // Which buffer this pane displays
|
||||
int start_row; // Starting row on screen
|
||||
int start_col; // Starting column on screen
|
||||
int height; // Height of this pane
|
||||
int width; // Width of this pane
|
||||
int origin_x, origin_y;
|
||||
int cursor_x; // Local cursor x in this pane
|
||||
int cursor_y; // Local cursor y in this pane
|
||||
int rx, ry;
|
||||
int row_offset; // Scroll offset for rows
|
||||
int col_offset; // Scroll offset for columns
|
||||
int x_offset, y_offset;
|
||||
int is_active; // Is this pane currently active
|
||||
} EditorPane;
|
||||
|
||||
@@ -95,15 +92,12 @@ enum buffer_type { FILE_BUFF, TERMINAL_BUFF };
|
||||
struct buffer_t {
|
||||
enum buffer_type type;
|
||||
int buffer_id;
|
||||
int width, height;
|
||||
int x, y; /**< Position in the buffer (cursor) */
|
||||
frow *row;
|
||||
int x, y; /**< Position in the file */
|
||||
row_t *row;
|
||||
int numrows;
|
||||
char *filename;
|
||||
enum bufferStatus_e state;
|
||||
int dirty; /**< Has this buffer been modified since last save */
|
||||
int row_offset; /**< Scroll offset for rows in this buffer */
|
||||
int col_offset; /**< Scroll offset for columns in this buffer */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -112,19 +106,16 @@ struct buffer_t {
|
||||
*/
|
||||
struct editorConfig {
|
||||
int cursor_x, cursor_y; /**< Cursor position */
|
||||
int rx; /**< Position in the render*/
|
||||
int row_offset; /**< Position scroll of lines */
|
||||
int col_offset; /**< Position scroll of colomns*/
|
||||
int screenrows; /**< Terminal height*/
|
||||
int screencols; /**< Terminal width*/
|
||||
|
||||
ScreenLayout layout;
|
||||
|
||||
int numrows; /**< Number of rows contained */
|
||||
row_t *rows; /**< Store all the rows printed */
|
||||
row_t *rows; /**< Store all the rows printed */
|
||||
|
||||
int dirty;
|
||||
int prefix_state;
|
||||
char status_msg[80];
|
||||
|
||||
char *status_msg;
|
||||
time_t status_msg_time;
|
||||
struct termios orig_termios; /**< Terminal communication interface */
|
||||
|
||||
@@ -143,6 +134,7 @@ struct editorConfig {
|
||||
|
||||
struct prefix_t *prefix;
|
||||
int number_of_prefix;
|
||||
int prefix_state;
|
||||
|
||||
struct buffer_t buffers[64];
|
||||
int number_of_buffer;
|
||||
|
||||
+2
-1
@@ -8,8 +8,9 @@
|
||||
#define HIDE_CURSOR "\x1b[?25l"
|
||||
#define SHOW_CURSOR "\x1b[?25h"
|
||||
#define ERASE_END_LINE "\x1b[K"
|
||||
#define TAB "\x09"
|
||||
#define TAB "\x9"
|
||||
#define SPACE "\x20"
|
||||
#define APP_DEBUG
|
||||
|
||||
enum editorKey_e {
|
||||
BACKSPACE = 127,
|
||||
|
||||
+3
-2
@@ -2,10 +2,11 @@
|
||||
#define EDITOR_OP_H_
|
||||
|
||||
#include "data.h"
|
||||
void bufferInsertChar(int c);
|
||||
|
||||
void bufferInsertNewLine();
|
||||
|
||||
void bufferInsertBytes(char *src, int n);
|
||||
void editorSetStatusMessage(const char *fmt, ...);
|
||||
void bufferDelBytes();
|
||||
|
||||
|
||||
#endif // EDITOR_OP_H_
|
||||
|
||||
@@ -8,15 +8,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
char *bufferRowsToString(struct buffer_t *buf,int *buffer_len);
|
||||
|
||||
|
||||
void editorCloseFile(void);
|
||||
|
||||
void editorOpen(struct buffer_t *buffer);
|
||||
|
||||
void editorSave();
|
||||
|
||||
void bufferFind(struct buffer_t *buf);
|
||||
|
||||
#endif // FILE_IO_H_
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
char *editorPrompt(char *prompt, char * PlaceHolder, char bPathMode);
|
||||
|
||||
char *key_to_string(int key);
|
||||
const char *file_completion(const char *path);
|
||||
|
||||
int editorMoveCursor(int key);
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
* \brief Draws left rows of the editor.
|
||||
*/
|
||||
|
||||
void editorDrawRows(struct abuf *ab);
|
||||
|
||||
void editorRefreshScreen();
|
||||
|
||||
void editorScroll();
|
||||
|
||||
+4
-12
@@ -10,17 +10,9 @@
|
||||
|
||||
void bufferInsertRow(struct buffer_t *buffer, int at, char *s, size_t len);
|
||||
int editorRowCxToByte(const row_t *row, int cursor_x);
|
||||
|
||||
int editorRowCharCount(row_t *row);
|
||||
|
||||
void bufferDelRow(struct buffer_t *buffer, int at);
|
||||
void editorRowInsertBytes(row_t *row, int at, const char *src, int len);
|
||||
|
||||
void editorRowDelByte(row_t *row, int at, int n);
|
||||
void bufferRowInsertChar(struct buffer_t *buffer, frow *row, int at, int c);
|
||||
|
||||
void bufferRowAppendString(struct buffer_t *buffer, frow *row, char *s, size_t len);
|
||||
|
||||
void bufferRowDelchar(struct buffer_t *buffer, frow *row, int at);
|
||||
void bufferFreeRow(row_t *row);
|
||||
int editorRowCharCount(row_t *row, int x);
|
||||
void bufferRowInsertBytes(struct buffer_t *buffer, row_t *row, int at, char *src, int n);
|
||||
void bufferRowDelByte(struct buffer_t *buffer, row_t *row, int at, int n);
|
||||
|
||||
#endif // ROW_OP_H_
|
||||
|
||||
@@ -33,4 +33,6 @@ int getWindowSize(int *rows, int *cols);
|
||||
|
||||
char *key_to_string(int key);
|
||||
|
||||
void appDebug(const char *fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user