NLM
This commit is contained in:
@@ -261,6 +261,9 @@ apars_handle_CSI(char leadchar, int *params, int count, char keychar)
|
|||||||
if (n == 4) {
|
if (n == 4) {
|
||||||
screen_set_insert_mode(yn);
|
screen_set_insert_mode(yn);
|
||||||
}
|
}
|
||||||
|
else if (n == 20) {
|
||||||
|
screen_set_newline_mode(yn);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// ansi_warn("NOIMPL flag %d", n);
|
// ansi_warn("NOIMPL flag %d", n);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ static struct {
|
|||||||
bool numpad_alt_mode; //!< Application Mode - affects how user input of control keys is sent
|
bool numpad_alt_mode; //!< Application Mode - affects how user input of control keys is sent
|
||||||
bool cursors_alt_mode; //!< Application mode for cursor keys
|
bool cursors_alt_mode; //!< Application mode for cursor keys
|
||||||
|
|
||||||
|
bool newline_mode;
|
||||||
|
|
||||||
char charset0;
|
char charset0;
|
||||||
char charset1;
|
char charset1;
|
||||||
} scr;
|
} scr;
|
||||||
@@ -194,6 +196,7 @@ screen_reset(void)
|
|||||||
|
|
||||||
scr.numpad_alt_mode = false;
|
scr.numpad_alt_mode = false;
|
||||||
scr.cursors_alt_mode = false;
|
scr.cursors_alt_mode = false;
|
||||||
|
scr.newline_mode = false;
|
||||||
|
|
||||||
scr.charset0 = 'B';
|
scr.charset0 = 'B';
|
||||||
scr.charset1 = '0';
|
scr.charset1 = '0';
|
||||||
@@ -701,6 +704,13 @@ screen_set_cursors_alt_mode(bool alt_mode)
|
|||||||
scr.cursors_alt_mode = alt_mode;
|
scr.cursors_alt_mode = alt_mode;
|
||||||
NOTIFY_DONE();
|
NOTIFY_DONE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ICACHE_FLASH_ATTR
|
||||||
|
screen_set_newline_mode(bool nlm)
|
||||||
|
{
|
||||||
|
scr.newline_mode = nlm;
|
||||||
|
}
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
//region --- Printing ---
|
//region --- Printing ---
|
||||||
@@ -720,6 +730,10 @@ screen_putchar(const char *ch)
|
|||||||
switch (ch[0]) {
|
switch (ch[0]) {
|
||||||
case '\r':
|
case '\r':
|
||||||
screen_cursor_set_x(0);
|
screen_cursor_set_x(0);
|
||||||
|
if (scr.newline_mode) {
|
||||||
|
// like LF
|
||||||
|
screen_cursor_move(1, 0, true);
|
||||||
|
}
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
case '\n':
|
case '\n':
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ void screen_cursor_restore(bool withAttrs);
|
|||||||
void screen_cursor_visible(bool visible);
|
void screen_cursor_visible(bool visible);
|
||||||
/** Enable auto wrap */
|
/** Enable auto wrap */
|
||||||
void screen_wrap_enable(bool enable);
|
void screen_wrap_enable(bool enable);
|
||||||
|
/** Enable CR auto */
|
||||||
|
void screen_set_newline_mode(bool nlm);
|
||||||
|
|
||||||
// --- Colors ---
|
// --- Colors ---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user