From d63e0e1f8dc5e10cb7c3f1d90e98d03b2c51f86b Mon Sep 17 00:00:00 2001 From: BanceDev Date: Thu, 5 Sep 2024 21:25:48 -0400 Subject: cleaned up syntax --- src/lush.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lush.c b/src/lush.c index 15e62af..1574b3c 100644 --- a/src/lush.c +++ b/src/lush.c @@ -148,7 +148,7 @@ static void reset_terminal_mode(struct termios *orig_termios) { tcsetattr(STDIN_FILENO, TCSANOW, orig_termios); } -int get_terminal_width() { +static int get_terminal_width() { struct winsize w; if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == -1) { perror("ioctl"); @@ -225,15 +225,13 @@ char *lush_read_line() { getchar(); // skip [ switch (getchar()) { case 'A': // up arrow - { reprint_buffer(buffer, &pos, ++history_pos); - } break; + break; case 'B': // down arrow - { reprint_buffer(buffer, &pos, --history_pos); if (history_pos < 0) history_pos = 0; - } break; + break; case 'C': // right arrow if (pos < strlen(buffer)) { pos++; -- cgit v1.2.3-59-g8ed1b