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
f034992e
Commit
f034992e
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: transform the token DISABLE_WRAPJUSTIFY to ENABLED_WRAPORJUSTIFY
parent
db0b849f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
src/global.c
+1
-1
src/global.c
src/nano.c
+7
-7
src/nano.c
src/nano.h
+2
-2
src/nano.h
src/proto.h
+2
-2
src/proto.h
src/rcfile.c
+2
-2
src/rcfile.c
src/text.c
+2
-2
src/text.c
with
16 additions
and
16 deletions
+16
-16
src/global.c
View file @
f034992e
...
...
@@ -84,7 +84,7 @@ int altleft, altright, altup, altdown;
int
shiftaltleft
,
shiftaltright
,
shiftaltup
,
shiftaltdown
;
#endif
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
ssize_t
fill
=
0
;
/* The column where we will wrap lines. */
ssize_t
wrap_at
=
-
CHARS_FROM_EOL
;
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
f034992e
...
...
@@ -721,7 +721,7 @@ void window_init(void)
keypad
(
bottomwin
,
TRUE
);
}
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
/* Set up the wrapping point, accounting for screen width when negative. */
fill
=
wrap_at
;
if
(
fill
<=
0
)
...
...
@@ -885,7 +885,7 @@ void usage(void)
print_opt
(
"-q"
,
"--quiet"
,
N_
(
"Silently ignore startup issues like rc file errors"
));
#endif
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
print_opt
(
_
(
"-r <#cols>"
),
_
(
"--fill=<#cols>"
),
N_
(
"Set hard-wrapping point at column #cols"
));
#endif
...
...
@@ -1893,7 +1893,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
int
main
(
int
argc
,
char
**
argv
)
{
int
optchr
;
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
bool
fill_used
=
FALSE
;
/* Was the fill option used on the command line? */
#ifdef ENABLE_WRAPPING
...
...
@@ -1945,7 +1945,7 @@ int main(int argc, char **argv)
#endif
{
"preserve"
,
0
,
NULL
,
'p'
},
{
"quiet"
,
0
,
NULL
,
'q'
},
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
{
"fill"
,
1
,
NULL
,
'r'
},
#endif
#ifndef DISABLE_SPELLER
...
...
@@ -2170,7 +2170,7 @@ int main(int argc, char **argv)
SET
(
QUIET
);
break
;
#endif
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
case
'r'
:
if
(
!
parse_num
(
optarg
,
&
wrap_at
))
{
fprintf
(
stderr
,
_
(
"Requested fill size
\"
%s
\"
is invalid"
),
optarg
);
...
...
@@ -2255,7 +2255,7 @@ int main(int argc, char **argv)
#ifdef ENABLE_OPERATINGDIR
char
*
operating_dir_cpy
=
operating_dir
;
#endif
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
ssize_t
wrap_at_cpy
=
wrap_at
;
#endif
#ifndef NANO_TINY
...
...
@@ -2302,7 +2302,7 @@ int main(int argc, char **argv)
operating_dir
=
operating_dir_cpy
;
}
#endif
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
if
(
fill_used
)
wrap_at
=
wrap_at_cpy
;
#endif
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
f034992e
...
...
@@ -128,8 +128,8 @@
#undef ENABLE_MOUSE
#endif
#if
!
defined(ENABLE_WRAPPING)
&& !
defined(ENABLE_JUSTIFY)
#define
DIS
ABLE_WRAPJUSTIFY 1
#if defined(ENABLE_WRAPPING)
||
defined(ENABLE_JUSTIFY)
#define
EN
ABLE
D
_WRAP
OR
JUSTIFY 1
#endif
#define BACKWARD FALSE
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
f034992e
...
...
@@ -83,7 +83,7 @@ extern int shiftaltup;
extern
int
shiftaltdown
;
#endif
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
extern
ssize_t
fill
;
extern
ssize_t
wrap_at
;
#endif
...
...
@@ -551,7 +551,7 @@ void update_undo(undo_type action);
void
wrap_reset
(
void
);
bool
do_wrap
(
filestruct
*
line
);
#endif
#if defined(ENABLE_HELP) ||
!
defined(
DIS
ABLE_WRAPJUSTIFY)
#if defined(ENABLE_HELP) || defined(
EN
ABLE
D
_WRAP
OR
JUSTIFY)
ssize_t
break_line
(
const
char
*
line
,
ssize_t
goal
,
bool
snap_at_nl
);
#endif
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
...
...
This diff is collapsed.
Click to expand it.
src/rcfile.c
View file @
f034992e
...
...
@@ -44,7 +44,7 @@ static const rcoption rcopts[] = {
#endif
{
"const"
,
CONSTANT_SHOW
},
/* deprecated form, remove in 2018 */
{
"constantshow"
,
CONSTANT_SHOW
},
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
{
"fill"
,
0
},
#endif
#ifdef ENABLE_HISTORIES
...
...
@@ -1106,7 +1106,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
operating_dir
=
option
;
else
#endif
#if
n
def
DIS
ABLE_WRAPJUSTIFY
#ifdef
EN
ABLE
D
_WRAP
OR
JUSTIFY
if
(
strcasecmp
(
rcopts
[
i
].
name
,
"fill"
)
==
0
)
{
if
(
!
parse_num
(
option
,
&
wrap_at
))
{
rcfile_error
(
N_
(
"Requested fill size
\"
%s
\"
is invalid"
),
...
...
This diff is collapsed.
Click to expand it.
src/text.c
View file @
f034992e
...
...
@@ -1668,7 +1668,7 @@ bool do_wrap(filestruct *line)
}
#endif
/* ENABLE_WRAPPING */
#if defined(ENABLE_HELP) ||
!
defined(
DIS
ABLE_WRAPJUSTIFY)
#if defined(ENABLE_HELP) || defined(
EN
ABLE
D
_WRAP
OR
JUSTIFY)
/* We are trying to break a chunk off line. We find the last blank such
* that the display length to there is at most (goal + 1). If there is
* no such blank, then we find the first blank. We then take the last
...
...
@@ -1740,7 +1740,7 @@ ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl)
return
lastblank
;
}
#endif
/* ENABLE_HELP ||
!DIS
ABLE_WRAPJUSTIFY */
#endif
/* ENABLE_HELP ||
EN
ABLE
D
_WRAP
OR
JUSTIFY */
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
/* The "indentation" of a line is the whitespace between the quote part
...
...
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