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
a05180ed
Commit
a05180ed
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: transform the token DISABLE_TABCOMP to ENABLE_TABCOMP
parent
00533854
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
configure.ac
+9
-5
configure.ac
src/files.c
+3
-3
src/files.c
src/nano.c
+2
-2
src/nano.c
src/prompt.c
+6
-6
src/prompt.c
src/proto.h
+3
-3
src/proto.h
src/search.c
+2
-2
src/search.c
with
25 additions
and
21 deletions
+25
-21
configure.ac
View file @
a05180ed
...
...
@@ -213,8 +213,15 @@ fi
AC_ARG_ENABLE(tabcomp,
AS_HELP_STRING([--disable-tabcomp], [Disable the tab-completion functions]))
if test "x$enable_tabcomp" = xno; then
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab-completion functions for filenames and search strings.])
if test "x$enable_tiny" = xyes; then
if test "x$enable_tabcomp" != xyes; then
enable_tabcomp=no
fi
fi
if test "x$disable_tabcomp" != xyes; then
if test "x$enable_tabcomp" != xno; then
AC_DEFINE(ENABLE_TABCOMP, 1, [Define this to have tab completion for filenames and search strings.])
fi
fi
AC_ARG_ENABLE(wordcomp,
...
...
@@ -285,9 +292,6 @@ if test "x$enable_tiny" = xyes; then
if test "x$enable_speller" != xyes; then
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell-checker functions.])
fi
if test "x$enable_tabcomp" != xyes; then
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab-completion functions for files and search strings.])
fi
if test "x$enable_wrapping" != xyes; then
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
fi
...
...
This diff is collapsed.
Click to expand it.
src/files.c
View file @
a05180ed
...
...
@@ -2385,7 +2385,7 @@ char *real_dir_from_tilde(const char *buf)
return
retval
;
}
#if
!
defined(
DIS
ABLE_TABCOMP) || defined(ENABLE_BROWSER)
#if defined(
EN
ABLE_TABCOMP) || defined(ENABLE_BROWSER)
/* Our sort routine for file listings. Sort alphabetically and
* case-insensitively, and sort directories before filenames. */
int
diralphasort
(
const
void
*
va
,
const
void
*
vb
)
...
...
@@ -2422,7 +2422,7 @@ void free_chararray(char **array, size_t len)
}
#endif
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
/* Is the given path a directory? */
bool
is_dir
(
const
char
*
buf
)
{
...
...
@@ -2746,7 +2746,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place,
return
buf
;
}
#endif
/*
!DIS
ABLE_TABCOMP */
#endif
/*
EN
ABLE_TABCOMP */
/* Return the filename part of the given path. */
const
char
*
tail
(
const
char
*
path
)
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
a05180ed
...
...
@@ -955,7 +955,7 @@ void version(void)
#ifndef DISABLE_SPELLER
printf
(
" --enable-speller"
);
#endif
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
printf
(
" --enable-tabcomp"
);
#endif
#ifndef DISABLE_WRAPPING
...
...
@@ -1004,7 +1004,7 @@ void version(void)
#ifdef DISABLE_SPELLER
printf
(
" --disable-speller"
);
#endif
#ifdef
DIS
ABLE_TABCOMP
#if
n
def
EN
ABLE_TABCOMP
printf
(
" --disable-tabcomp"
);
#endif
#ifndef ENABLE_WORDCOMPLETION
...
...
This diff is collapsed.
Click to expand it.
src/prompt.c
View file @
a05180ed
...
...
@@ -431,7 +431,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
int
kbinput
=
ERR
;
bool
ran_func
,
finished
;
functionptrtype
func
;
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
bool
tabbed
=
FALSE
;
/* Whether we've pressed Tab. */
#endif
...
...
@@ -441,7 +441,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
char
*
magichistory
=
NULL
;
/* The temporary string typed at the bottom of the history, if
* any. */
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
int
last_kbinput
=
ERR
;
/* The key we pressed before the current key. */
size_t
complete_len
=
0
;
...
...
@@ -482,7 +482,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
if
(
func
==
do_cancel
||
func
==
do_enter
)
break
;
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
if
(
func
!=
do_tab
)
tabbed
=
FALSE
;
...
...
@@ -503,7 +503,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
answer
=
input_tab
(
answer
,
allow_files
,
&
statusbar_x
,
&
tabbed
,
refresh_func
,
listed
);
}
else
#endif
/*
!DIS
ABLE_TABCOMP */
#endif
/*
EN
ABLE_TABCOMP */
#ifndef DISABLE_HISTORIES
if
(
func
==
get_history_older_void
)
{
if
(
history_list
!=
NULL
)
{
...
...
@@ -567,7 +567,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
update_the_statusbar
();
#if !defined(DISABLE_HISTORIES) &&
!
defined(
DIS
ABLE_TABCOMP)
#if !defined(DISABLE_HISTORIES) && defined(
EN
ABLE_TABCOMP)
last_kbinput
=
kbinput
;
#endif
}
...
...
@@ -658,7 +658,7 @@ int do_prompt(bool allow_tabs, bool allow_files,
fprintf
(
stderr
,
"answer =
\"
%s
\"\n
"
,
answer
);
#endif
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
/* If we've done tab completion, there might still be a list of
* filename matches on the edit window. Clear them off. */
if
(
listed
)
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
a05180ed
...
...
@@ -304,11 +304,11 @@ void do_writeout_void(void);
void
do_savefile
(
void
);
#endif
char
*
real_dir_from_tilde
(
const
char
*
buf
);
#if
!
defined(
DIS
ABLE_TABCOMP) || defined(ENABLE_BROWSER)
#if defined(
EN
ABLE_TABCOMP) || defined(ENABLE_BROWSER)
int
diralphasort
(
const
void
*
va
,
const
void
*
vb
);
void
free_chararray
(
char
**
array
,
size_t
len
);
#endif
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
char
*
input_tab
(
char
*
buf
,
bool
allow_files
,
size_t
*
place
,
bool
*
lastwastab
,
void
(
*
refresh_func
)(
void
),
bool
*
listed
);
#endif
...
...
@@ -496,7 +496,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
void
do_gotolinecolumn_void
(
void
);
#ifndef NANO_TINY
void
do_find_bracket
(
void
);
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
char
*
get_history_completion
(
filestruct
**
h
,
char
*
s
,
size_t
len
);
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
src/search.c
View file @
a05180ed
...
...
@@ -1224,7 +1224,7 @@ void get_history_older_void(void)
;
}
#if
n
def
DIS
ABLE_TABCOMP
#ifdef
EN
ABLE_TABCOMP
/* Move h to the next string that's a tab completion of the string s,
* looking at only the first len characters of s, and return that
* string. If there isn't one, or if len is 0, don't move h and return
...
...
@@ -1277,5 +1277,5 @@ char *get_history_completion(filestruct **h, char *s, size_t len)
* match, or len is 0. Return s. */
return
(
char
*
)
s
;
}
#endif
/*
!DI
SABLE_TABCOMP */
#endif
/*
EN
SABLE_TABCOMP */
#endif
/* !DISABLE_HISTORIES */
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