Renaming UP_DIR and DOWN_DIR to UPWARD and DOWNWARD, for clarity,
to reduce the slight confusion with DIR meaning directory. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5013 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
4cf39e4191
Коммит
ce0ea44596
@ -1,3 +1,7 @@
|
|||||||
|
2014-06-23 Benno Schulenberg <bensberg@justemail.net>
|
||||||
|
* src/nano.h, src/move.c (do_up, do_down), src/winio.c (edit_scrol):
|
||||||
|
Rename UP_DIR and DOWN_DIR to UPWARD and DOWNWARD, for clarity.
|
||||||
|
|
||||||
2014-06-22 Benno Schulenberg <bensberg@justemail.net>
|
2014-06-22 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/browser.c (parse_browser_input), src/help.c (parse_help_input):
|
* src/browser.c (parse_browser_input), src/help.c (parse_help_input):
|
||||||
Remove two pointless calls of get_shortcut(), and adjust the comments.
|
Remove two pointless calls of get_shortcut(), and adjust the comments.
|
||||||
|
@ -523,7 +523,7 @@ void do_up(
|
|||||||
|| (ISSET(SOFTWRAP) && openfile->edittop->lineno == openfile->current->next->lineno) || scroll_only
|
|| (ISSET(SOFTWRAP) && openfile->edittop->lineno == openfile->current->next->lineno) || scroll_only
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
edit_scroll(UP_DIR,
|
edit_scroll(UPWARD,
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
(ISSET(SMOOTH_SCROLL) || scroll_only) ? 1 :
|
(ISSET(SMOOTH_SCROLL) || scroll_only) ? 1 :
|
||||||
#endif
|
#endif
|
||||||
@ -616,7 +616,7 @@ void do_down(
|
|||||||
if (amount < 1 || scroll_only)
|
if (amount < 1 || scroll_only)
|
||||||
amount = 1;
|
amount = 1;
|
||||||
#endif
|
#endif
|
||||||
edit_scroll(DOWN_DIR,
|
edit_scroll(DOWNWARD,
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
(ISSET(SMOOTH_SCROLL) || scroll_only) ? amount :
|
(ISSET(SMOOTH_SCROLL) || scroll_only) ? amount :
|
||||||
#endif
|
#endif
|
||||||
|
@ -175,7 +175,7 @@ typedef enum {
|
|||||||
} append_type;
|
} append_type;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
UP_DIR, DOWN_DIR
|
UPWARD, DOWNWARD
|
||||||
} scroll_dir;
|
} scroll_dir;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
20
src/winio.c
20
src/winio.c
@ -2995,8 +2995,8 @@ void compute_maxrows(void)
|
|||||||
|
|
||||||
/* Scroll the edit window in the given direction and the given number
|
/* Scroll the edit window in the given direction and the given number
|
||||||
* of lines, and draw new lines on the blank lines left after the
|
* of lines, and draw new lines on the blank lines left after the
|
||||||
* scrolling. direction is the direction to scroll, either UP_DIR or
|
* scrolling. direction is the direction to scroll, either UPWARD or
|
||||||
* DOWN_DIR, and nlines is the number of lines to scroll. We change
|
* DOWNWARD, and nlines is the number of lines to scroll. We change
|
||||||
* edittop, and assume that current and current_x are up to date. We
|
* edittop, and assume that current and current_x are up to date. We
|
||||||
* also assume that scrollok(edit) is FALSE. */
|
* also assume that scrollok(edit) is FALSE. */
|
||||||
void edit_scroll(scroll_dir direction, ssize_t nlines)
|
void edit_scroll(scroll_dir direction, ssize_t nlines)
|
||||||
@ -3019,7 +3019,7 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
|
|||||||
* value of direction) nlines lines, or as many lines as we can if
|
* value of direction) nlines lines, or as many lines as we can if
|
||||||
* there are fewer than nlines lines available. */
|
* there are fewer than nlines lines available. */
|
||||||
for (i = nlines; i > 0; i--) {
|
for (i = nlines; i > 0; i--) {
|
||||||
if (direction == UP_DIR) {
|
if (direction == UPWARD) {
|
||||||
if (openfile->edittop == openfile->fileage)
|
if (openfile->edittop == openfile->fileage)
|
||||||
break;
|
break;
|
||||||
openfile->edittop = openfile->edittop->prev;
|
openfile->edittop = openfile->edittop->prev;
|
||||||
@ -3031,7 +3031,7 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
|
|||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Don't over-scroll on long lines. */
|
/* Don't over-scroll on long lines. */
|
||||||
if (ISSET(SOFTWRAP) && direction == UP_DIR) {
|
if (ISSET(SOFTWRAP) && direction == UPWARD) {
|
||||||
ssize_t len = strlenpt(openfile->edittop->data) / COLS;
|
ssize_t len = strlenpt(openfile->edittop->data) / COLS;
|
||||||
i -= len;
|
i -= len;
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
@ -3055,7 +3055,7 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
|
|||||||
/* Scroll the text of the edit window up or down nlines lines,
|
/* Scroll the text of the edit window up or down nlines lines,
|
||||||
* depending on the value of direction. */
|
* depending on the value of direction. */
|
||||||
scrollok(edit, TRUE);
|
scrollok(edit, TRUE);
|
||||||
wscrl(edit, (direction == UP_DIR) ? -nlines : nlines);
|
wscrl(edit, (direction == UPWARD) ? -nlines : nlines);
|
||||||
scrollok(edit, FALSE);
|
scrollok(edit, FALSE);
|
||||||
|
|
||||||
/* Part 2: nlines is the number of lines in the scrolled region of
|
/* Part 2: nlines is the number of lines in the scrolled region of
|
||||||
@ -3063,8 +3063,8 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
|
|||||||
|
|
||||||
/* If the top or bottom line of the file is now visible in the edit
|
/* If the top or bottom line of the file is now visible in the edit
|
||||||
* window, we need to draw the entire edit window. */
|
* window, we need to draw the entire edit window. */
|
||||||
if ((direction == UP_DIR && openfile->edittop ==
|
if ((direction == UPWARD && openfile->edittop ==
|
||||||
openfile->fileage) || (direction == DOWN_DIR &&
|
openfile->fileage) || (direction == DOWNWARD &&
|
||||||
openfile->edittop->lineno + editwinrows - 1 >=
|
openfile->edittop->lineno + editwinrows - 1 >=
|
||||||
openfile->filebot->lineno))
|
openfile->filebot->lineno))
|
||||||
nlines = editwinrows;
|
nlines = editwinrows;
|
||||||
@ -3085,7 +3085,7 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
|
|||||||
|
|
||||||
/* If we scrolled down, move down to the line before the scrolled
|
/* If we scrolled down, move down to the line before the scrolled
|
||||||
* region. */
|
* region. */
|
||||||
if (direction == DOWN_DIR) {
|
if (direction == DOWNWARD) {
|
||||||
for (i = editwinrows - nlines; i > 0 && foo != NULL; i--)
|
for (i = editwinrows - nlines; i > 0 && foo != NULL; i--)
|
||||||
foo = foo->next;
|
foo = foo->next;
|
||||||
}
|
}
|
||||||
@ -3096,8 +3096,8 @@ void edit_scroll(scroll_dir direction, ssize_t nlines)
|
|||||||
* blank, so we don't need to draw it unless the mark is on or we're
|
* blank, so we don't need to draw it unless the mark is on or we're
|
||||||
* not on the first page. */
|
* not on the first page. */
|
||||||
for (i = nlines; i > 0 && foo != NULL; i--) {
|
for (i = nlines; i > 0 && foo != NULL; i--) {
|
||||||
if ((i == nlines && direction == DOWN_DIR) || (i == 1 &&
|
if ((i == nlines && direction == DOWNWARD) || (i == 1 &&
|
||||||
direction == UP_DIR)) {
|
direction == UPWARD)) {
|
||||||
if (do_redraw)
|
if (do_redraw)
|
||||||
update_line(foo, (foo == openfile->current) ?
|
update_line(foo, (foo == openfile->current) ?
|
||||||
openfile->current_x : 0);
|
openfile->current_x : 0);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user