error handling when editing file permissions
Still highly non-ideal. Lua is a dynamic language, and has low ability to detect syntax errors within functions. Perhaps I should run a test call after every edit.
This commit is contained in:
parent
e3cef7ee56
commit
be0c936276
22
src/kilo.c
22
src/kilo.c
|
@ -1331,7 +1331,27 @@ void resumeNonCodeEdit() {
|
|||
E.cols = COLS-LINE_NUMBER_SPACE;
|
||||
E.startrow = CALLERS_SPACE;
|
||||
E.endrow = LINES-MENU_SPACE;
|
||||
editorRefreshScreen(editorMenu);
|
||||
editorRefreshScreen(editorNonCodeMenu);
|
||||
int c = getch();
|
||||
editorProcessKeypress2(c);
|
||||
}
|
||||
}
|
||||
|
||||
void resumeNonCodeEdit2() {
|
||||
Quit = 0;
|
||||
Back_to_big_picture = 0;
|
||||
E.startcol = LINE_NUMBER_SPACE;
|
||||
E.startrow = 1; /* space for function header */
|
||||
E.endrow = 10; /* nudge people to keep function short */
|
||||
while(!Quit) {
|
||||
/* update on resize */
|
||||
E.cols = COLS-LINE_NUMBER_SPACE;
|
||||
editorRefreshScreen(editorNonCodeMenu);
|
||||
int y, x;
|
||||
getyx(stdscr, y, x);
|
||||
mvaddstr(0, 0, "function file_operation_permitted(filename, mode)");
|
||||
mvaddstr(E.startrow + E.numrows - E.rowoff, 0, "end");
|
||||
mvaddstr(y, x, "");
|
||||
int c = getch();
|
||||
editorProcessKeypress2(c);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue