Commits

Anonymous committed 672738c

small scrolling fix

Comments (0)

Files changed (1)

 #define STDOUT 1
 #define STDERR 2
 
-/*
- * I like these because they make sure you never evaluate something twice in the macro,
- * think function call or increment, but they aren't part of C99 so I have to get rid
- * of the -pedantic when I compile, but I like what that catches for me. Until I find
- * a better way to use these, I'll just have to be safe with the unsafe versions.
- *#define MIN(x,y) ({ typeof(x) _x = (x); typeof(y) _y = (y); (_x < _y) ? _x : _y; })
- *#define MAX(x,y) ({ typeof(x) _x = (x); typeof(y) _y = (y); (_x > _y) ? _x : _y; })
- */
-
+// make sure not to use anything that can't be evaluated twice
 #define MIN(x,y) ((x) < (y) ? (x) : (y))
 #define MAX(x,y) ((x) > (y) ? (x) : (y))
 
 
 	start = start_pos(start, cur, len, cols);
 
-	if (start > 0) {
+	if (start > 0 || len > cols) {
 		left_prompt_len = strlen(scrl_prompt_left);
 		my_write(STDOUT, scrl_prompt_left, left_prompt_len);
 		cols = ws.ws_col - 1 - left_prompt_len;