Commit 928babf8 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

cosmetic fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2407 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 9 additions and 8 deletions
+9 -8
...@@ -89,7 +89,7 @@ filestruct *read_line(char *buf, filestruct *prev, bool *first_line_ins, ...@@ -89,7 +89,7 @@ filestruct *read_line(char *buf, filestruct *prev, bool *first_line_ins,
fileptr->prev = NULL; fileptr->prev = NULL;
fileptr->next = fileage; fileptr->next = fileage;
fileptr->lineno = 1; fileptr->lineno = 1;
if (*first_line_ins) { if (*first_line_ins == TRUE) {
*first_line_ins = FALSE; *first_line_ins = FALSE;
/* If we're inserting into the first line of the file, then /* If we're inserting into the first line of the file, then
* we want to make sure that our edit buffer stays on the * we want to make sure that our edit buffer stays on the
...@@ -100,6 +100,7 @@ filestruct *read_line(char *buf, filestruct *prev, bool *first_line_ins, ...@@ -100,6 +100,7 @@ filestruct *read_line(char *buf, filestruct *prev, bool *first_line_ins,
fileage = fileptr; fileage = fileptr;
} else { } else {
assert(prev != NULL); assert(prev != NULL);
fileptr->prev = prev; fileptr->prev = prev;
fileptr->next = NULL; fileptr->next = NULL;
fileptr->lineno = prev->lineno + 1; fileptr->lineno = prev->lineno + 1;
...@@ -2429,7 +2430,7 @@ char *do_browser(char *path, DIR *dir) ...@@ -2429,7 +2430,7 @@ char *do_browser(char *path, DIR *dir)
/* Loop invariant: Microsoft sucks. */ /* Loop invariant: Microsoft sucks. */
do { do {
bool abort = FALSE; bool abort = FALSE;
int j, col = 0, editline = 0, lineno; int j, col = 0, editline = 0, fileline;
int filecols = 0; int filecols = 0;
/* Used only if width == 0, to calculate the number of files /* Used only if width == 0, to calculate the number of files
* per row below. */ * per row below. */
...@@ -2444,9 +2445,9 @@ char *do_browser(char *path, DIR *dir) ...@@ -2444,9 +2445,9 @@ char *do_browser(char *path, DIR *dir)
/* Compute the line number we're on now, so that we don't divide /* Compute the line number we're on now, so that we don't divide
* by zero later. */ * by zero later. */
lineno = selected; fileline = selected;
if (width != 0) if (width != 0)
lineno /= width; fileline /= width;
switch (kbinput) { switch (kbinput) {
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
...@@ -2463,7 +2464,7 @@ char *do_browser(char *path, DIR *dir) ...@@ -2463,7 +2464,7 @@ char *do_browser(char *path, DIR *dir)
/* longest is the width of each column. There are /* longest is the width of each column. There are
* two spaces between each column. */ * two spaces between each column. */
selected = (lineno / editwinrows) * editwinrows * selected = (fileline / editwinrows) * editwinrows *
width + mevent.y * width + mevent.x / width + mevent.y * width + mevent.x /
(longest + 2); (longest + 2);
...@@ -2508,9 +2509,9 @@ char *do_browser(char *path, DIR *dir) ...@@ -2508,9 +2509,9 @@ char *do_browser(char *path, DIR *dir)
case NANO_PREVPAGE_KEY: case NANO_PREVPAGE_KEY:
case NANO_PREVPAGE_FKEY: case NANO_PREVPAGE_FKEY:
case '-': /* Pico compatibility. */ case '-': /* Pico compatibility. */
if (selected >= (editwinrows + lineno % editwinrows) * if (selected >= (editwinrows + fileline % editwinrows) *
width) width)
selected -= (editwinrows + lineno % editwinrows) * selected -= (editwinrows + fileline % editwinrows) *
width; width;
else else
selected = 0; selected = 0;
...@@ -2518,7 +2519,7 @@ char *do_browser(char *path, DIR *dir) ...@@ -2518,7 +2519,7 @@ char *do_browser(char *path, DIR *dir)
case NANO_NEXTPAGE_KEY: case NANO_NEXTPAGE_KEY:
case NANO_NEXTPAGE_FKEY: case NANO_NEXTPAGE_FKEY:
case ' ': /* Pico compatibility. */ case ' ': /* Pico compatibility. */
selected += (editwinrows - lineno % editwinrows) * selected += (editwinrows - fileline % editwinrows) *
width; width;
if (selected >= numents) if (selected >= numents)
selected = numents - 1; selected = numents - 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment