aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar BanceDev 2024-09-05 21:25:48 -0400
committerGravatar BanceDev 2024-09-05 21:25:48 -0400
commitd63e0e1f8dc5e10cb7c3f1d90e98d03b2c51f86b (patch)
tree2b8edf9293cb58a028111c875c911ed2f7743975
parentUpdate CONTRIBUTING.md (diff)
cleaned up syntax
-rw-r--r--src/lush.c8
1 files changed, 3 insertions, 5 deletions
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++;