fix moving cursor
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
tmp/*
|
tmp/*
|
||||||
bin/*
|
bin/*
|
||||||
|
doc/*
|
||||||
|
|||||||
+4
-4
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
void editorMoveCursor(struct editorConfig *E, int key) {
|
void editorMoveCursor(struct editorConfig *E, int key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case CURSOR_LEFT:
|
case CURSOR_RIGHT:
|
||||||
if (E->cursor_x != 0) {
|
if (E->cursor_x != 0) {
|
||||||
--E->cursor_x;
|
--E->cursor_x;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CURSOR_DOWN:
|
case CURSOR_DOWN:
|
||||||
if (E->cursor_x != E->screencols - 1) {
|
if (E->cursor_y != E->screenrows - 1) {
|
||||||
++E->cursor_y;
|
++E->cursor_y;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -17,8 +17,8 @@ void editorMoveCursor(struct editorConfig *E, int key) {
|
|||||||
--E->cursor_y;
|
--E->cursor_y;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CURSOR_RIGHT:
|
case CURSOR_LEFT:
|
||||||
if (E->cursor_y != E->screenrows - 1) {
|
if (E->cursor_x != E->screencols - 1) {
|
||||||
++E->cursor_x;
|
++E->cursor_x;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user