diff options
| author | 2024-09-05 21:25:48 -0400 | |
|---|---|---|
| committer | 2024-09-05 21:25:48 -0400 | |
| commit | d63e0e1f8dc5e10cb7c3f1d90e98d03b2c51f86b (patch) | |
| tree | 2b8edf9293cb58a028111c875c911ed2f7743975 | |
| parent | Update CONTRIBUTING.md (diff) | |
cleaned up syntax
| -rw-r--r-- | src/lush.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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++; |
