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
97eb0e51
Commit
97eb0e51
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle some stuff in a more logical order
parent
68010d93
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nano.c
+14
-16
src/nano.c
with
14 additions
and
16 deletions
+14
-16
src/nano.c
View file @
97eb0e51
...
...
@@ -692,6 +692,11 @@ void die_save_file(const char *die_filename, struct stat *die_stat)
/* Initialize the three window portions nano uses. */
void
window_init
(
void
)
{
/* First delete existing windows, in case of resizing. */
delwin
(
topwin
);
delwin
(
edit
);
delwin
(
bottomwin
);
/* Compute how many lines the edit subwindow will have. */
editwinrows
=
LINES
-
TOP_ROWS
-
BOTTOM_ROWS
;
...
...
@@ -699,22 +704,6 @@ void window_init(void)
if
(
editwinrows
<=
0
)
die
(
_
(
"Window size is too small for nano...
\n
"
));
#ifndef DISABLE_WRAPJUSTIFY
/* Set up fill, based on the screen width. */
fill
=
wrap_at
;
if
(
fill
<=
0
)
fill
+=
COLS
;
if
(
fill
<
0
)
fill
=
0
;
#endif
if
(
topwin
!=
NULL
)
delwin
(
topwin
);
if
(
edit
!=
NULL
)
delwin
(
edit
);
if
(
bottomwin
!=
NULL
)
delwin
(
bottomwin
);
/* Set up the windows. */
topwin
=
newwin
(
TOP_ROWS
,
COLS
,
0
,
0
);
edit
=
newwin
(
editwinrows
,
COLS
,
TOP_ROWS
,
0
);
...
...
@@ -726,6 +715,15 @@ void window_init(void)
keypad
(
edit
,
TRUE
);
keypad
(
bottomwin
,
TRUE
);
}
#ifndef DISABLE_WRAPJUSTIFY
/* Set up the wrapping point, accounting for screen width when negative. */
fill
=
wrap_at
;
if
(
fill
<=
0
)
fill
+=
COLS
;
if
(
fill
<
0
)
fill
=
0
;
#endif
}
#ifndef DISABLE_MOUSE
...
...
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