-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathedit.h
More file actions
72 lines (56 loc) · 2.26 KB
/
edit.h
File metadata and controls
72 lines (56 loc) · 2.26 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef EMSYS_EDIT_H
#define EMSYS_EDIT_H
#include "emsys.h"
/* Character insertion */
void editorInsertChar(struct editorBuffer *bufr, int c, int count);
void editorInsertUnicode(struct editorBuffer *bufr, int count);
/* Line operations */
void editorInsertNewline(struct editorBuffer *bufr, int count);
void editorOpenLine(struct editorBuffer *bufr, int count);
void editorInsertNewlineAndIndent(struct editorBuffer *bufr, int count);
/* Indentation */
void editorIndent(struct editorBuffer *bufr, int rept);
void editorUnindent(struct editorBuffer *bufr, int rept);
void editorIndentTabs(struct editorConfig *ed, struct editorBuffer *buf);
void editorIndentSpaces(struct editorConfig *ed, struct editorBuffer *buf);
/* Character deletion */
void editorDelChar(struct editorBuffer *bufr, int count);
void editorBackSpace(struct editorBuffer *bufr, int count);
/* Boundary detection */
int isWordBoundary(uint8_t c);
int isParaBoundary(erow *row);
/* Cursor movement */
void editorMoveCursor(int key, int count);
/* Word movement */
void bufferEndOfForwardWord(struct editorBuffer *buf, int *dx, int *dy);
void bufferEndOfBackwardWord(struct editorBuffer *buf, int *dx, int *dy);
void editorForwardWord(int count);
void editorBackWord(int count);
/* Paragraph movement */
void editorBackPara(int count);
void editorForwardPara(int count);
/* Word transformations */
void wordTransform(struct editorBuffer *bufr, int times,
uint8_t *(*transformer)(uint8_t *));
void editorUpcaseWord(struct editorBuffer *bufr, int times);
void editorDowncaseWord(struct editorBuffer *bufr, int times);
void editorCapitalCaseWord(struct editorBuffer *bufr, int times);
/* Word deletion */
void editorDeleteWord(struct editorBuffer *bufr, int count);
void editorBackspaceWord(struct editorBuffer *bufr, int count);
/* Character/word transposition */
void editorTransposeWords(struct editorBuffer *bufr);
void editorTransposeChars(struct editorBuffer *bufr);
/* Line operations */
void editorKillLine(int count);
void editorKillLineBackwards(void);
/* Navigation */
void editorGotoLine(void);
void editorPageUp(int count);
void editorPageDown(int count);
void editorBeginningOfLine(int count);
void editorEndOfLine(int count);
void editorQuit(void);
/* External constants */
extern const int page_overlap;
#endif