Skip to content
GitLab
Menu
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
f2ac2011
Commit
f2ac2011
authored
8 years ago
by
David Lawrence Ramsey
Committed by
Benno Schulenberg
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: adjust and correct some comments
parent
da564385
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cut.c
+2
-2
src/cut.c
src/move.c
+3
-5
src/move.c
src/winio.c
+11
-12
src/winio.c
with
16 additions
and
19 deletions
+16
-19
src/cut.c
View file @
f2ac2011
...
...
@@ -223,7 +223,7 @@ void do_copy_text(void)
static
struct
filestruct
*
next_contiguous_line
=
NULL
;
bool
mark_set
=
openfile
->
mark_set
;
/* Remember the current view
port and cursor position. */
/* Remember the current viewport and cursor position. */
ssize_t
is_edittop_lineno
=
openfile
->
edittop
->
lineno
;
ssize_t
is_current_lineno
=
openfile
->
current
->
lineno
;
size_t
is_current_x
=
openfile
->
current_x
;
...
...
@@ -237,7 +237,7 @@ void do_copy_text(void)
next_contiguous_line
=
(
mark_set
?
NULL
:
openfile
->
current
);
if
(
mark_set
)
{
/* Restore the view
port and cursor position. */
/* Restore the viewport and cursor position. */
openfile
->
edittop
=
fsfromline
(
is_edittop_lineno
);
openfile
->
current
=
fsfromline
(
is_current_lineno
);
openfile
->
current_x
=
is_current_x
;
...
...
This diff is collapsed.
Click to expand it.
src/move.c
View file @
f2ac2011
...
...
@@ -488,11 +488,9 @@ void do_down(bool scroll_only)
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
openfile
->
placewewant
);
/* If scroll_only is FALSE and if we're on the last line of the
* edit window, scroll the edit window down one line if we're in
* smooth scrolling mode, or down half a page if we're not. If
* scroll_only is TRUE, scroll the edit window down one line
* unconditionally. */
/* When the cursor was on the last line of the edit window (or when just
* scrolling without moving the cursor), scroll the edit window down -- one
* line if we're in smooth scrolling mode, and half a page otherwise. */
#ifndef NANO_TINY
if
(
openfile
->
current_y
==
editwinrows
-
1
||
amount
>
0
||
scroll_only
)
{
if
(
amount
<
1
||
scroll_only
)
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
f2ac2011
...
...
@@ -2909,8 +2909,8 @@ void edit_redraw(filestruct *old_current)
if
(
old_current
!=
openfile
->
current
&&
get_page_start
(
was_pww
)
>
0
)
update_line
(
old_current
,
0
);
/* Update current if
we've
changed page, or if it
differs from
* old_current and needs to be horizontally scrolled. */
/* Update current if
the mark is on or it has
changed
"
page
"
, or if it
*
differs from
old_current and needs to be horizontally scrolled. */
if
(
need_horizontal_scroll
(
was_pww
,
openfile
->
placewewant
)
||
(
old_current
!=
openfile
->
current
&&
get_page_start
(
openfile
->
placewewant
)
>
0
))
...
...
@@ -2969,15 +2969,14 @@ void adjust_viewport(update_type manner)
{
int
goal
=
0
;
/* If manner is CENTERING, move edittop half the number of window
* lines back from current. If manner is STATIONARY, move edittop
* back current_y lines if current_y is in range of the screen,
* 0 lines if current_y is below zero, or (editwinrows - 1) lines
* if current_y is too big. This puts current at the same place
* on the screen as before, or at the top or bottom if current_y is
* beyond either. If manner is FLOWING, move edittop back 0 lines
* or (editwinrows - 1) lines, depending or where current has moved.
* This puts the cursor on the first or the last line. */
/* If manner is CENTERING, move edittop half the number of window rows
* back from current. If manner is FLOWING, move edittop back 0 rows
* or (editwinrows - 1) rows, depending on where current has moved.
* This puts the cursor on the first or the last row. If manner is
* STATIONARY, move edittop back current_y rows if current_y is in range
* of the screen, 0 rows if current_y is below zero, or (editwinrows - 1)
* rows if current_y is too big. This puts current at the same place on
* the screen as before, or... at some undefined place. */
if
(
manner
==
CENTERING
)
goal
=
editwinrows
/
2
;
else
if
(
manner
==
FLOWING
)
{
...
...
@@ -2991,7 +2990,7 @@ void adjust_viewport(update_type manner)
}
else
{
goal
=
openfile
->
current_y
;
/* Limit goal to (editwinrows - 1)
line
s maximum. */
/* Limit goal to (editwinrows - 1)
row
s maximum. */
if
(
goal
>
editwinrows
-
1
)
goal
=
editwinrows
-
1
;
}
...
...
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