I am wondering why do we need put back the cursor at origin with the EscH command in the editorRefreshScreen() function after we have implemented editorMoveCursor() ?
Calling snprintf(buf, sizeof(buf), "\x1b[%d;%dH", E.cy + 1, E.cx + 1); should be enough to reposition the cursor and yet it is not :
I tried to erase abAppend(&ab, "\x1b[H", 3); from editorRefreshScreen() but then I noticed that the line which we happen to have the cursor on gets displayed on the first line.
Do you know the reason beahind this strange behaviour ?
I am wondering why do we need put back the cursor at origin with the EscH command in the editorRefreshScreen() function after we have implemented editorMoveCursor() ? Calling snprintf(buf, sizeof(buf), "\x1b[%d;%dH", E.cy + 1, E.cx + 1); should be enough to reposition the cursor and yet it is not : I tried to erase abAppend(&ab, "\x1b[H", 3); from editorRefreshScreen() but then I noticed that the line which we happen to have the cursor on gets displayed on the first line. Do you know the reason beahind this strange behaviour ?
Thanks in advance.