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
db0b849f
Commit
db0b849f
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: transform the token DISABLE_JUSTIFY to ENABLE_JUSTIFY
parent
c4d2a92d
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
configure.ac
+7
-5
configure.ac
src/chars.c
+4
-4
src/chars.c
src/global.c
+23
-23
src/global.c
src/move.c
+2
-2
src/move.c
src/nano.c
+10
-10
src/nano.c
src/nano.h
+1
-1
src/nano.h
src/proto.h
+7
-7
src/proto.h
src/rcfile.c
+3
-3
src/rcfile.c
src/text.c
+5
-5
src/text.c
with
62 additions
and
60 deletions
+62
-60
configure.ac
View file @
db0b849f
...
...
@@ -144,8 +144,13 @@ fi
AC_ARG_ENABLE(justify,
AS_HELP_STRING([--disable-justify], [Disable the justify/unjustify functions]))
if test "x$enable_justify" = xno; then
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
if test "x$enable_tiny" = xyes; then
if test "x$enable_justify" != xyes; then
enable_justify=no
fi
fi
if test "x$enable_justify" != xno; then
AC_DEFINE(ENABLE_JUSTIFY, 1, [Define this to have the routines for justifying.])
fi
AC_ARG_ENABLE(libmagic,
...
...
@@ -277,9 +282,6 @@ if test "x$enable_tiny" = xyes; then
if test "x$enable_extra" != xyes; then
AC_DEFINE(DISABLE_EXTRA, 1, [Define this to disable extra stuff.])
fi
if test "x$enable_justify" != xyes; then
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
fi
if test "x$enable_libmagic" != xyes; then
enable_libmagic=no
fi
...
...
This diff is collapsed.
Click to expand it.
src/chars.c
View file @
db0b849f
...
...
@@ -579,7 +579,7 @@ size_t mbstrnlen(const char *s, size_t maxlen)
return
strnlen
(
s
,
maxlen
);
}
#if !defined(NANO_TINY) ||
!
defined(
DIS
ABLE_JUSTIFY)
#if !defined(NANO_TINY) || defined(
EN
ABLE_JUSTIFY)
/* This function is equivalent to strchr() for multibyte strings. */
char
*
mbstrchr
(
const
char
*
s
,
const
char
*
c
)
{
...
...
@@ -620,7 +620,7 @@ char *mbstrchr(const char *s, const char *c)
#endif
return
(
char
*
)
strchr
(
s
,
*
c
);
}
#endif
/* !NANO_TINY ||
!DIS
ABLE_JUSTIFY */
#endif
/* !NANO_TINY ||
EN
ABLE_JUSTIFY */
#ifndef NANO_TINY
/* This function is equivalent to strpbrk() for multibyte strings. */
...
...
@@ -686,7 +686,7 @@ char *mbrevstrpbrk(const char *head, const char *accept, const char *pointer)
}
#endif
/* !NANO_TINY */
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) ||
!
defined(
DIS
ABLE_JUSTIFY))
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(
EN
ABLE_JUSTIFY))
/* Return TRUE if the string s contains one or more blank characters,
* and FALSE otherwise. */
bool
has_blank_chars
(
const
char
*
s
)
...
...
@@ -719,7 +719,7 @@ bool has_blank_mbchars(const char *s)
#endif
return
has_blank_chars
(
s
);
}
#endif
/* ENABLE_NANORC && (!NANO_TINY ||
!DIS
ABLE_JUSTIFY) */
#endif
/* ENABLE_NANORC && (!NANO_TINY ||
EN
ABLE_JUSTIFY) */
#ifdef ENABLE_UTF8
/* Return TRUE if wc is valid Unicode, and FALSE otherwise. */
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
db0b849f
...
...
@@ -135,7 +135,7 @@ int whitespace_len[2];
/* The length in bytes of these characters. */
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
char
*
punct
=
NULL
;
/* The closing punctuation that can end sentences. */
char
*
brackets
=
NULL
;
...
...
@@ -149,7 +149,7 @@ int quoterc;
/* Whether it was compiled successfully. */
char
*
quoteerr
=
NULL
;
/* The error message, if it didn't. */
#endif
/* !DISABLE_JUSTIFY */
#endif
char
*
word_chars
=
NULL
;
/* Nonalphanumeric characters that also form words. */
...
...
@@ -493,7 +493,7 @@ void print_sclist(void)
const
char
*
exit_tag
=
N_
(
"Exit"
);
const
char
*
close_tag
=
N_
(
"Close"
);
const
char
*
uncut_tag
=
N_
(
"Uncut Text"
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
const
char
*
unjust_tag
=
N_
(
"Unjustify"
);
#endif
...
...
@@ -508,7 +508,7 @@ void shortcut_init(void)
const
char
*
nextline_tag
=
N_
(
"Next Line"
);
const
char
*
prevpage_tag
=
N_
(
"Prev Page"
);
const
char
*
nextpage_tag
=
N_
(
"Next Page"
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
const
char
*
justify_tag
=
N_
(
"Justify"
);
const
char
*
fulljustify_tag
=
N_
(
"FullJstify"
);
#endif
...
...
@@ -578,7 +578,7 @@ void shortcut_init(void)
const
char
*
end_gist
=
N_
(
"Go to end of current line"
);
const
char
*
prevblock_gist
=
N_
(
"Go to previous block of text"
);
const
char
*
nextblock_gist
=
N_
(
"Go to next block of text"
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
const
char
*
parabegin_gist
=
N_
(
"Go to beginning of paragraph; then of previous paragraph"
);
const
char
*
paraend_gist
=
...
...
@@ -611,7 +611,7 @@ void shortcut_init(void)
const
char
*
cuttilleof_gist
=
N_
(
"Cut from the cursor position to the end of the file"
);
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
const
char
*
justify_gist
=
N_
(
"Justify the current paragraph"
);
const
char
*
fulljustify_gist
=
N_
(
"Justify the entire file"
);
#endif
...
...
@@ -708,7 +708,7 @@ void shortcut_init(void)
add_to_funcs
(
do_writeout_void
,
MMAIN
,
N_
(
"Write Out"
),
WITHORSANS
(
writeout_gist
),
TOGETHER
,
NOVIEW
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
if
(
!
ISSET
(
RESTRICTED
))
{
#else
/* If we can't replace Insert with Justify, show Insert anyway, to
...
...
@@ -725,7 +725,7 @@ void shortcut_init(void)
NOVIEW
);
#endif
}
else
{
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_funcs
(
do_justify_void
,
MMAIN
,
justify_tag
,
WITHORSANS
(
justify_gist
),
BLANKAFTER
,
NOVIEW
);
#endif
...
...
@@ -770,7 +770,7 @@ void shortcut_init(void)
uncutfunc
=
tailfunc
;
if
(
!
ISSET
(
RESTRICTED
))
{
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_funcs
(
do_justify_void
,
MMAIN
,
justify_tag
,
WITHORSANS
(
justify_gist
),
TOGETHER
,
NOVIEW
);
#endif
...
...
@@ -792,8 +792,8 @@ void shortcut_init(void)
add_to_funcs
(
do_cursorpos_void
,
MMAIN
,
N_
(
"Cur Pos"
),
WITHORSANS
(
cursorpos_gist
),
TOGETHER
,
VIEW
);
#if (
!
defined(
DIS
ABLE_JUSTIFY) && (!defined(DISABLE_SPELLER) || !defined(DISABLE_COLOR)) || \
defined(
DIS
ABLE_JUSTIFY) && defined(DISABLE_SPELLER) && defined(DISABLE_COLOR))
#if (defined(
EN
ABLE_JUSTIFY) && (!defined(DISABLE_SPELLER) || !defined(DISABLE_COLOR)) || \
!
defined(
EN
ABLE_JUSTIFY) && defined(DISABLE_SPELLER) && defined(DISABLE_COLOR))
/* Conditionally placing this one here or further on, to keep the
* help items nicely paired in most conditions. */
add_to_funcs
(
do_gotolinecolumn_void
,
MMAIN
,
...
...
@@ -825,7 +825,7 @@ void shortcut_init(void)
add_to_funcs
(
flip_replace
,
MREPLACE
,
N_
(
"No Replace"
),
WITHORSANS
(
whereis_gist
),
BLANKAFTER
,
VIEW
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_funcs
(
do_full_justify
,
MWHEREIS
,
fulljustify_tag
,
WITHORSANS
(
fulljustify_gist
),
TOGETHER
,
NOVIEW
);
...
...
@@ -882,7 +882,7 @@ void shortcut_init(void)
N_
(
"Prev Block"
),
WITHORSANS
(
prevblock_gist
),
TOGETHER
,
VIEW
);
add_to_funcs
(
do_next_block
,
MMAIN
,
N_
(
"Next Block"
),
WITHORSANS
(
nextblock_gist
),
TOGETHER
,
VIEW
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_funcs
(
do_para_begin_void
,
MMAIN
|
MWHEREIS
,
N_
(
"Beg of Par"
),
WITHORSANS
(
parabegin_gist
),
TOGETHER
,
VIEW
);
add_to_funcs
(
do_para_end_void
,
MMAIN
|
MWHEREIS
,
...
...
@@ -906,8 +906,8 @@ void shortcut_init(void)
N_
(
"Next File"
),
WITHORSANS
(
nextfile_gist
),
BLANKAFTER
,
VIEW
);
#endif
#if (defined(
DIS
ABLE_JUSTIFY) && (!defined(DISABLE_SPELLER) || !defined(DISABLE_COLOR)) || \
!
defined(
DIS
ABLE_JUSTIFY) && defined(DISABLE_SPELLER) && defined(DISABLE_COLOR))
#if (
!
defined(
EN
ABLE_JUSTIFY) && (!defined(DISABLE_SPELLER) || !defined(DISABLE_COLOR)) || \
defined(
EN
ABLE_JUSTIFY) && defined(DISABLE_SPELLER) && defined(DISABLE_COLOR))
add_to_funcs
(
do_gotolinecolumn_void
,
MMAIN
,
gotoline_tag
,
WITHORSANS
(
gotoline_gist
),
BLANKAFTER
,
VIEW
);
#endif
...
...
@@ -944,7 +944,7 @@ void shortcut_init(void)
N_
(
"CutTillEnd"
),
WITHORSANS
(
cuttilleof_gist
),
BLANKAFTER
,
NOVIEW
);
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_funcs
(
do_full_justify
,
MMAIN
,
fulljustify_tag
,
WITHORSANS
(
fulljustify_gist
),
TOGETHER
,
NOVIEW
);
#endif
...
...
@@ -999,7 +999,7 @@ void shortcut_init(void)
N_
(
"NextHstory"
),
WITHORSANS
(
nexthistory_gist
),
BLANKAFTER
,
VIEW
);
#endif
#ifdef
DIS
ABLE_JUSTIFY
#if
n
def
EN
ABLE_JUSTIFY
add_to_funcs
(
do_gotolinecolumn_void
,
MWHEREIS
,
gotoline_tag
,
WITHORSANS
(
gotoline_gist
),
BLANKAFTER
,
VIEW
);
#endif
...
...
@@ -1102,7 +1102,7 @@ void shortcut_init(void)
add_to_sclist
(
MMOST
,
"F9"
,
0
,
do_cut_text_void
,
0
);
add_to_sclist
(
MMOST
,
"^U"
,
0
,
do_uncut_text
,
0
);
add_to_sclist
(
MMOST
,
"F10"
,
0
,
do_uncut_text
,
0
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_sclist
(
MMAIN
,
"^J"
,
0
,
do_justify_void
,
0
);
add_to_sclist
(
MMAIN
,
"F4"
,
0
,
do_justify_void
,
0
);
#endif
...
...
@@ -1204,7 +1204,7 @@ void shortcut_init(void)
}
add_to_sclist
(
MMAIN
,
"M-7"
,
0
,
do_prev_block
,
0
);
add_to_sclist
(
MMAIN
,
"M-8"
,
0
,
do_next_block
,
0
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_sclist
(
MMAIN
,
"M-("
,
0
,
do_para_begin_void
,
0
);
add_to_sclist
(
MMAIN
,
"M-9"
,
0
,
do_para_begin_void
,
0
);
add_to_sclist
(
MMAIN
,
"M-)"
,
0
,
do_para_end_void
,
0
);
...
...
@@ -1227,7 +1227,7 @@ void shortcut_init(void)
add_to_sclist
(
MMAIN
,
"M-T"
,
0
,
do_cut_till_eof
,
0
);
add_to_sclist
(
MMAIN
,
"M-D"
,
0
,
do_wordlinechar_count
,
0
);
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_sclist
(
MMAIN
|
MWHEREIS
,
"M-J"
,
0
,
do_full_justify
,
0
);
#endif
add_to_sclist
(
MMAIN
|
MHELP
,
"^L"
,
0
,
total_refresh
,
0
);
...
...
@@ -1277,7 +1277,7 @@ void shortcut_init(void)
add_to_sclist
(
MWHEREIS
|
MREPLACE
,
"^R"
,
0
,
flip_replace
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
|
MFINDINHELP
,
"^Y"
,
0
,
do_first_line
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
|
MGOTOLINE
|
MFINDINHELP
,
"^V"
,
0
,
do_last_line
,
0
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
,
"^W"
,
0
,
do_para_begin_void
,
0
);
add_to_sclist
(
MWHEREIS
|
MREPLACE
|
MREPLACEWITH
,
"^O"
,
0
,
do_para_end_void
,
0
);
#endif
...
...
@@ -1516,7 +1516,7 @@ sc *strtosc(const char *input)
s
->
scfunc
=
do_cursorpos_void
;
else
if
(
!
strcasecmp
(
input
,
"gotoline"
))
s
->
scfunc
=
do_gotolinecolumn_void
;
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
else
if
(
!
strcasecmp
(
input
,
"justify"
))
s
->
scfunc
=
do_justify_void
;
else
if
(
!
strcasecmp
(
input
,
"fulljustify"
))
...
...
@@ -1777,7 +1777,7 @@ void thanks_for_all_the_fish(void)
delwin
(
bottomwin
);
free
(
word_chars
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
free
(
quotestr
);
regfree
(
&
quotereg
);
free
(
quoteerr
);
...
...
This diff is collapsed.
Click to expand it.
src/move.c
View file @
db0b849f
...
...
@@ -169,7 +169,7 @@ void do_page_down(void)
refresh_needed
=
TRUE
;
}
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
/* Move to the beginning of the last beginning-of-paragraph line before the
* current line. If update_screen is TRUE, update the screen afterwards. */
void
do_para_begin
(
bool
update_screen
)
...
...
@@ -229,7 +229,7 @@ void do_para_end_void(void)
{
do_para_end
(
TRUE
);
}
#endif
/*
!DIS
ABLE_JUSTIFY */
#endif
/*
EN
ABLE_JUSTIFY */
/* Move to the preceding block of text. */
void
do_prev_block
(
void
)
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
db0b849f
...
...
@@ -830,7 +830,7 @@ void usage(void)
print_opt
(
"-P"
,
"--positionlog"
,
N_
(
"Log & read location of cursor position"
));
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
print_opt
(
_
(
"-Q <str>"
),
_
(
"--quotestr=<str>"
),
N_
(
"Quoting string"
));
#endif
if
(
!
ISSET
(
RESTRICTED
))
...
...
@@ -942,7 +942,7 @@ void version(void)
#ifdef ENABLE_HISTORIES
printf
(
" --enable-histories"
);
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
printf
(
" --enable-justify"
);
#endif
#ifdef HAVE_LIBMAGIC
...
...
@@ -991,7 +991,7 @@ void version(void)
#ifndef ENABLE_HISTORIES
printf
(
" --disable-histories"
);
#endif
#ifdef
DIS
ABLE_JUSTIFY
#if
n
def
EN
ABLE_JUSTIFY
printf
(
" --disable-justify"
);
#endif
#ifndef HAVE_LIBMAGIC
...
...
@@ -1917,7 +1917,7 @@ int main(int argc, char **argv)
{
"rebindkeypad"
,
0
,
NULL
,
'K'
},
{
"nonewlines"
,
0
,
NULL
,
'L'
},
{
"morespace"
,
0
,
NULL
,
'O'
},
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
{
"quotestr"
,
1
,
NULL
,
'Q'
},
#endif
{
"restricted"
,
0
,
NULL
,
'R'
},
...
...
@@ -2088,7 +2088,7 @@ int main(int argc, char **argv)
SET
(
POS_HISTORY
);
break
;
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
case
'Q'
:
quotestr
=
mallocstrcpy
(
quotestr
,
optarg
);
break
;
...
...
@@ -2262,7 +2262,7 @@ int main(int argc, char **argv)
char
*
backup_dir_cpy
=
backup_dir
;
char
*
word_chars_cpy
=
word_chars
;
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
char
*
quotestr_cpy
=
quotestr
;
#endif
#ifndef DISABLE_SPELLER
...
...
@@ -2281,7 +2281,7 @@ int main(int argc, char **argv)
backup_dir
=
NULL
;
word_chars
=
NULL
;
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
quotestr
=
NULL
;
#endif
#ifndef DISABLE_SPELLER
...
...
@@ -2316,7 +2316,7 @@ int main(int argc, char **argv)
word_chars
=
word_chars_cpy
;
}
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
if
(
quotestr_cpy
!=
NULL
)
{
free
(
quotestr
);
quotestr
=
quotestr_cpy
;
...
...
@@ -2390,7 +2390,7 @@ int main(int argc, char **argv)
init_operating_dir
();
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
/* If punct wasn't specified, set its default value. */
if
(
punct
==
NULL
)
punct
=
mallocstrcpy
(
NULL
,
"!.?"
);
...
...
@@ -2414,7 +2414,7 @@ int main(int argc, char **argv)
quoteerr
=
charalloc
(
size
);
regerror
(
quoterc
,
&
quotereg
,
quoteerr
,
size
);
}
#endif
/*
!DIS
ABLE_JUSTIFY */
#endif
/*
EN
ABLE_JUSTIFY */
#ifndef DISABLE_SPELLER
/* If we don't have an alternative spell checker after reading the
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
db0b849f
...
...
@@ -128,7 +128,7 @@
#undef ENABLE_MOUSE
#endif
#if !defined(ENABLE_WRAPPING) && defined(
DIS
ABLE_JUSTIFY)
#if !defined(ENABLE_WRAPPING) &&
!
defined(
EN
ABLE_JUSTIFY)
#define DISABLE_WRAPJUSTIFY 1
#endif
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
db0b849f
...
...
@@ -116,7 +116,7 @@ extern int whitespace_len[2];
extern
const
char
*
exit_tag
;
extern
const
char
*
close_tag
;
extern
const
char
*
uncut_tag
;
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
extern
const
char
*
unjust_tag
;
extern
char
*
punct
;
extern
char
*
brackets
;
...
...
@@ -124,7 +124,7 @@ extern char *quotestr;
extern
regex_t
quotereg
;
extern
int
quoterc
;
extern
char
*
quoteerr
;
#endif
/* !
DIS
ABLE_JUSTIFY */
#endif
/* !
EN
ABLE_JUSTIFY */
extern
char
*
word_chars
;
...
...
@@ -226,7 +226,7 @@ char *mbrevstrcasestr(const char *haystack, const char *needle,
const
char
*
index
);
size_t
mbstrlen
(
const
char
*
s
);
size_t
mbstrnlen
(
const
char
*
s
,
size_t
maxlen
);
#if !defined(NANO_TINY) ||
!
defined(
DIS
ABLE_JUSTIFY)
#if !defined(NANO_TINY) || defined(
EN
ABLE_JUSTIFY)
char
*
mbstrchr
(
const
char
*
s
,
const
char
*
c
);
#endif
#ifndef NANO_TINY
...
...
@@ -234,7 +234,7 @@ char *mbstrpbrk(const char *s, const char *accept);
char
*
revstrpbrk
(
const
char
*
head
,
const
char
*
accept
,
const
char
*
index
);
char
*
mbrevstrpbrk
(
const
char
*
head
,
const
char
*
accept
,
const
char
*
index
);
#endif
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) ||
!
defined(
DIS
ABLE_JUSTIFY))
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(
EN
ABLE_JUSTIFY))
bool
has_blank_mbchars
(
const
char
*
s
);
#endif
#ifdef ENABLE_UTF8
...
...
@@ -378,7 +378,7 @@ void do_first_line(void);
void
do_last_line
(
void
);
void
do_page_up
(
void
);
void
do_page_down
(
void
);
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
void
do_para_begin
(
bool
update_screen
);
void
do_para_end
(
bool
update_screen
);
void
do_para_begin_void
(
void
);
...
...
@@ -554,10 +554,10 @@ bool do_wrap(filestruct *line);
#if defined(ENABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY)
ssize_t
break_line
(
const
char
*
line
,
ssize_t
goal
,
bool
snap_at_nl
);
#endif
#if !defined(NANO_TINY) ||
!
defined(
DIS
ABLE_JUSTIFY)
#if !defined(NANO_TINY) || defined(
EN
ABLE_JUSTIFY)
size_t
indent_length
(
const
char
*
line
);
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
void
justify_format
(
filestruct
*
paragraph
,
size_t
skip
);
bool
begpar
(
const
filestruct
*
const
foo
);
bool
inpar
(
const
filestruct
*
const
foo
);
...
...
This diff is collapsed.
Click to expand it.
src/rcfile.c
View file @
db0b849f
...
...
@@ -39,7 +39,7 @@ static const rcoption rcopts[] = {
#ifdef ENABLE_LINENUMBERS
{
"linenumbers"
,
LINE_NUMBERS
},
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
{
"brackets"
,
0
},
#endif
{
"const"
,
CONSTANT_SHOW
},
/* deprecated form, remove in 2018 */
...
...
@@ -71,7 +71,7 @@ static const rcoption rcopts[] = {
{
"positionlog"
,
POS_HISTORY
},
#endif
{
"preserve"
,
PRESERVE
},
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
{
"punct"
,
0
},
{
"quotestr"
,
0
},
#endif
...
...
@@ -1138,7 +1138,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
}
}
else
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
if
(
strcasecmp
(
rcopts
[
i
].
name
,
"punct"
)
==
0
)
{
punct
=
option
;
if
(
has_blank_mbchars
(
punct
))
{
...
...
This diff is collapsed.
Click to expand it.
src/text.c
View file @
db0b849f
...
...
@@ -39,7 +39,7 @@ static pid_t pid = -1;
static
bool
prepend_wrap
=
FALSE
;
/* Should we prepend wrapped text to the next line? */
#endif
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
static
filestruct
*
jusbuffer
=
NULL
;
/* The buffer where we store unjustified text. */
static
filestruct
*
jusbottom
=
NULL
;
...
...
@@ -1742,7 +1742,7 @@ ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl)
}
#endif
/* ENABLE_HELP || !DISABLE_WRAPJUSTIFY */
#if !defined(NANO_TINY) ||
!
defined(
DIS
ABLE_JUSTIFY)
#if !defined(NANO_TINY) || defined(
EN
ABLE_JUSTIFY)
/* The "indentation" of a line is the whitespace between the quote part
* and the non-whitespace of the line. */
size_t
indent_length
(
const
char
*
line
)
...
...
@@ -1763,9 +1763,9 @@ size_t indent_length(const char *line)
return
len
;
}
#endif
/* !NANO_TINY ||
!DIS
ABLE_JUSTIFY */
#endif
/* !NANO_TINY ||
EN
ABLE_JUSTIFY */
#if
n
def
DIS
ABLE_JUSTIFY
#ifdef
EN
ABLE_JUSTIFY
/* justify_format() replaces blanks with spaces and multiple spaces by 1
* (except it maintains up to 2 after a character in punct optionally
* followed by a character in brackets, and removes all from the end).
...
...
@@ -2556,7 +2556,7 @@ void do_full_justify(void)
{
do_justify
(
TRUE
);
}
#endif
/*
!DIS
ABLE_JUSTIFY */
#endif
/*
EN
ABLE_JUSTIFY */
#ifndef DISABLE_SPELLER
/* A word is misspelled in the file. Let the user replace it. We
...
...
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