Handling for tab characters
modified: src/nms.c
This commit is contained in:
parent
b1d29cd6fe
commit
1ce3eaa7b1
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#define SPACE 32
|
#define SPACE 32
|
||||||
#define NEWLINE 10
|
#define NEWLINE 10
|
||||||
|
#define TAB 9
|
||||||
|
|
||||||
#define KNRM "\x1B[0m"
|
#define KNRM "\x1B[0m"
|
||||||
#define KMAG "\x1B[35m"
|
#define KMAG "\x1B[35m"
|
||||||
@ -47,6 +48,8 @@ int main(void) {
|
|||||||
if (c == NEWLINE) {
|
if (c == NEWLINE) {
|
||||||
++y;
|
++y;
|
||||||
x = 1;
|
x = 1;
|
||||||
|
} else if (c == TAB && x + 4 <= termSizeCols) {
|
||||||
|
x += 4;
|
||||||
} else if (isspace(c)) {
|
} else if (isspace(c)) {
|
||||||
if (++x > termSizeCols) {
|
if (++x > termSizeCols) {
|
||||||
++y;
|
++y;
|
||||||
|
Loading…
Reference in New Issue
Block a user