Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
21ffa883
Commit
21ffa883
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: use mnemonic constants instead of TRUE and FALSE
And use these constants in another context too.
parent
98ec41b4
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/files.c
+4
-4
src/files.c
src/move.c
+2
-2
src/move.c
src/nano.h
+3
-4
src/nano.h
src/proto.h
+1
-1
src/proto.h
src/winio.c
+4
-4
src/winio.c
with
14 additions
and
15 deletions
+14
-15
src/files.c
View file @
21ffa883
...
...
@@ -639,16 +639,16 @@ void switch_to_adjacent_buffer(bool to_next)
#endif
}
/* Switch to the previous entry in the
openfile filebuffer
. */
/* Switch to the previous entry in the
list of open files
. */
void
switch_to_prev_buffer
(
void
)
{
switch_to_adjacent_buffer
(
FALSE
);
switch_to_adjacent_buffer
(
BACKWARD
);
}
/* Switch to the next entry in the
openfile filebuffer
. */
/* Switch to the next entry in the
list of open files
. */
void
switch_to_next_buffer
(
void
)
{
switch_to_adjacent_buffer
(
TRUE
);
switch_to_adjacent_buffer
(
FORWARD
);
}
/* Delete an entry from the circular list of open files, and switch to the
...
...
This diff is collapsed.
Click to expand it.
src/move.c
View file @
21ffa883
...
...
@@ -502,7 +502,7 @@ void do_up(bool scroll_only)
set_proper_index_and_pww
(
&
leftedge
,
target_column
,
FALSE
);
if
(
scroll_only
)
edit_scroll
(
UP
WARD
,
1
);
edit_scroll
(
BACK
WARD
,
1
);
edit_redraw
(
was_current
,
FLOWING
);
...
...
@@ -526,7 +526,7 @@ void do_down(bool scroll_only)
set_proper_index_and_pww
(
&
leftedge
,
target_column
,
TRUE
);
if
(
scroll_only
)
edit_scroll
(
DOWN
WARD
,
1
);
edit_scroll
(
FOR
WARD
,
1
);
edit_redraw
(
was_current
,
FLOWING
);
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
21ffa883
...
...
@@ -132,6 +132,9 @@
#define DISABLE_WRAPJUSTIFY 1
#endif
#define BACKWARD FALSE
#define FORWARD TRUE
/* Enumeration types. */
typedef
enum
{
NIX_FILE
,
DOS_FILE
,
MAC_FILE
...
...
@@ -149,10 +152,6 @@ typedef enum {
SOFTMARK
,
HARDMARK
}
mark_type
;
typedef
enum
{
UPWARD
,
DOWNWARD
}
scroll_dir
;
typedef
enum
{
CENTERING
,
FLOWING
,
STATIONARY
}
update_type
;
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
21ffa883
...
...
@@ -663,7 +663,7 @@ bool line_needs_update(const size_t old_column, const size_t new_column);
int
go_back_chunks
(
int
nrows
,
filestruct
**
line
,
size_t
*
leftedge
);
int
go_forward_chunks
(
int
nrows
,
filestruct
**
line
,
size_t
*
leftedge
);
bool
less_than_a_screenful
(
size_t
was_lineno
,
size_t
was_leftedge
);
void
edit_scroll
(
scroll_dir
direction
,
int
nrows
);
void
edit_scroll
(
bool
direction
,
int
nrows
);
#ifndef NANO_TINY
size_t
get_softwrap_breakpoint
(
const
char
*
text
,
size_t
leftedge
,
bool
*
end_of_line
);
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
21ffa883
...
...
@@ -2902,7 +2902,7 @@ bool less_than_a_screenful(size_t was_lineno, size_t was_leftedge)
/* Scroll the edit window in the given direction and the given number of rows,
* and draw new lines on the blank lines left after the scrolling. */
void
edit_scroll
(
scroll_dir
direction
,
int
nrows
)
void
edit_scroll
(
bool
direction
,
int
nrows
)
{
filestruct
*
line
;
size_t
leftedge
;
...
...
@@ -2912,7 +2912,7 @@ void edit_scroll(scroll_dir direction, int nrows)
/* Move the top line of the edit window the requested number of rows up or
* down, and reduce the number of rows with the amount we couldn't move. */
if
(
direction
==
UP
WARD
)
if
(
direction
==
BACK
WARD
)
nrows
-=
go_back_chunks
(
nrows
,
&
openfile
->
edittop
,
&
openfile
->
firstcolumn
);
else
nrows
-=
go_forward_chunks
(
nrows
,
&
openfile
->
edittop
,
&
openfile
->
firstcolumn
);
...
...
@@ -2935,7 +2935,7 @@ void edit_scroll(scroll_dir direction, int nrows)
/* Scroll the text of the edit window a number of rows up or down. */
scrollok
(
edit
,
TRUE
);
wscrl
(
edit
,
(
direction
==
UP
WARD
)
?
-
nrows
:
nrows
);
wscrl
(
edit
,
(
direction
==
BACK
WARD
)
?
-
nrows
:
nrows
);
scrollok
(
edit
,
FALSE
);
/* Part 2: nrows is now the number of rows in the scrolled region of the
...
...
@@ -2951,7 +2951,7 @@ void edit_scroll(scroll_dir direction, int nrows)
leftedge
=
openfile
->
firstcolumn
;
/* If we scrolled forward, move down to the start of the blank region. */
if
(
direction
==
DOWN
WARD
)
if
(
direction
==
FOR
WARD
)
go_forward_chunks
(
editwinrows
-
nrows
,
&
line
,
&
leftedge
);
#ifndef NANO_TINY
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help