-
Notifications
You must be signed in to change notification settings - Fork 1
/
micro.c
43 lines (34 loc) · 1 KB
/
micro.c
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
#include "micro.h"
#include "terminalManipulation.h"
#include "fileIO.h"
#include "output.h"
#include "input.h"
void initializeMicro()
{
microConfig.cursorPosX = microConfig.cursorPosY = microConfig.numRows = microConfig.rowOffset = microConfig.colOffset = microConfig.renderPosX = microConfig.dirtyBuffer = 0;
microConfig.row = NULL;
microConfig.fileName = NULL;
microConfig.statusMessage[0] = '\0';
microConfig.statusMessage_time = 0;
if (getTerminalWindowSize(µConfig.screenRows, µConfig.screenCols) == -1)
die("getTerminalWindowSize");
microConfig.screenRows -= 2;
}
int main(int argc, char *argv[])
{
enableRawInputMode();
initializeMicro();
if (argc >= 2)
{
microOpen(argv[1]);
}
microSetStatusMessage("To Exit: Ctrl-q | To Save: Ctrl-s | To Find: Ctrl-f");
while (1)
{
microRefreshScreen();
microProcessKeypress();
}
return 0;
}
// End of file single-line comment
/* End of file multi-line comment */