Anonymous avatar 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;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.