A few more cosmetic tweaks and type fixes.
Patch by David Lawrence Ramsey. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4952 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
1102aaa374
Коммит
6af5bdea27
@ -6,6 +6,8 @@
|
||||
debugging stuff -- line numbers are long, x positions unsigned long.
|
||||
* src/files.c, src/move.c, src/nano.c, src/text.c, src/winio.c:
|
||||
Make tiny nano a bit tinier by preening out some soft-wrap stuff.
|
||||
* src/global.c, src/nano.c, src/winio.c: A few more cosmetic tweaks
|
||||
(whitespace, order, braces, parentheses, and a typo) and type fixes.
|
||||
|
||||
2014-06-09 Benno Schulenberg <bensberg@justemail.net>
|
||||
* src/nano.c (do_input): Remove two superfluous false conditions.
|
||||
|
@ -330,7 +330,7 @@ const sc *first_sc_for(int menu, void (*func)(void))
|
||||
return s;
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Whoops, returning null given func %ld in menu %x\n", (long) func, menu);
|
||||
fprintf(stderr, "Whoops, returning null given func %ld in menu %x\n", (long)func, menu);
|
||||
#endif
|
||||
/* Otherwise... */
|
||||
return NULL;
|
||||
@ -371,7 +371,7 @@ void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggl
|
||||
assign_keyinfo(s);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Setting sequence to %d for shortcut \"%s\" in menu %x\n", s->seq, scstring, (int) s->menu);
|
||||
fprintf(stderr, "Setting sequence to %d for shortcut \"%s\" in menu %x\n", s->seq, scstring, (int)s->menu);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1763,7 +1763,7 @@ int do_mouse(void)
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
for (openfile->current = openfile->edittop;
|
||||
openfile->current->next && i < mouse_y;
|
||||
openfile->current = openfile->current->next, i++) {
|
||||
@ -1773,7 +1773,8 @@ int do_mouse(void)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "do_mouse(): moving to current_y = %d, i %d\n", openfile->current_y, i);
|
||||
fprintf(stderr, "do_mouse(): moving to current_y = %ld, index i = %lu\n",
|
||||
(long)openfile->current_y, (unsigned long)i);
|
||||
fprintf(stderr, " openfile->current->data = \"%s\"\n", openfile->current->data);
|
||||
#endif
|
||||
|
||||
|
11
src/winio.c
11
src/winio.c
@ -2453,7 +2453,7 @@ void reset_cursor(void)
|
||||
openfile->current_y = 0;
|
||||
|
||||
for (tmp = openfile->edittop; tmp && tmp != openfile->current; tmp = tmp->next)
|
||||
openfile->current_y += 1 + strlenpt(tmp->data) / COLS;
|
||||
openfile->current_y += (strlenpt(tmp->data) / COLS) + 1;
|
||||
|
||||
openfile->current_y += xplustabs() / COLS;
|
||||
if (openfile->current_y < editwinrows)
|
||||
@ -2868,9 +2868,8 @@ int update_line(filestruct *fileptr, size_t index)
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
filestruct *tmp;
|
||||
|
||||
for (tmp = openfile->edittop; tmp && tmp != fileptr; tmp = tmp->next) {
|
||||
line += 1 + (strlenpt(tmp->data) / COLS);
|
||||
}
|
||||
for (tmp = openfile->edittop; tmp && tmp != fileptr; tmp = tmp->next)
|
||||
line += (strlenpt(tmp->data) / COLS) + 1;
|
||||
} else
|
||||
#endif
|
||||
line = fileptr->lineno - openfile->edittop->lineno;
|
||||
@ -3033,7 +3032,7 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Don't over-scroll on long lines. */
|
||||
if (ISSET(SOFTWRAP) && (direction == UP_DIR)) {
|
||||
if (ISSET(SOFTWRAP) && direction == UP_DIR) {
|
||||
ssize_t len = strlenpt(openfile->edittop->data) / COLS;
|
||||
i -= len;
|
||||
if (len > 0)
|
||||
@ -3287,7 +3286,7 @@ void edit_update(update_type location)
|
||||
}
|
||||
openfile->edittop = foo;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "edit_udpate(), setting edittop to lineno %ld\n", (long)openfile->edittop->lineno);
|
||||
fprintf(stderr, "edit_update(), setting edittop to lineno %ld\n", (long)openfile->edittop->lineno);
|
||||
#endif
|
||||
compute_maxrows();
|
||||
edit_refresh_needed = TRUE;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user