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
964c10db
Commit
964c10db
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: miscellaneous frobbings and rewrappings
parent
0e010809
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure.ac
+2
-3
configure.ac
src/files.c
+3
-6
src/files.c
src/global.c
+4
-3
src/global.c
src/text.c
+7
-8
src/text.c
with
16 additions
and
20 deletions
+16
-20
configure.ac
View file @
964c10db
...
...
@@ -88,13 +88,12 @@ if test "x$enable_tiny" = xyes; then
if test "x$enable_comment" = xyes; then
AC_MSG_ERROR([--enable-comment cannot work with --enable-tiny])
else
# Disabling nanorc silently disables comment support.
enable_comment=no
fi
fi
if test "x$disable_comment" != xyes; then
if test "x$enable_comment" != xno; then
AC_DEFINE(ENABLE_COMMENT, 1, [Define this to
dis
able the comment/uncomment function
ality
.])
AC_DEFINE(ENABLE_COMMENT, 1, [Define this to
en
able the comment/uncomment function.])
fi
fi
...
...
@@ -173,7 +172,7 @@ fi
AC_ARG_ENABLE(tabcomp,
AS_HELP_STRING([--disable-tabcomp], [Disable tab completion functions]))
if test "x$enable_tabcomp" = xno; then
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab completion functions for files and search strings.])
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab completion functions for file
name
s and search strings.])
fi
AC_ARG_ENABLE(wordcomp,
...
...
This diff is collapsed.
Click to expand it.
src/files.c
View file @
964c10db
...
...
@@ -2234,8 +2234,7 @@ int do_writeout(bool exiting)
/* If we're using restricted mode, and the filename isn't blank,
* disable tab completion. */
i
=
do_prompt
(
!
ISSET
(
RESTRICTED
)
||
openfile
->
filename
[
0
]
==
'\0'
,
i
=
do_prompt
(
!
ISSET
(
RESTRICTED
)
||
openfile
->
filename
[
0
]
==
'\0'
,
#ifndef DISABLE_TABCOMP
TRUE
,
#endif
...
...
@@ -2997,10 +2996,8 @@ void load_history(void)
ssize_t
read
;
while
((
read
=
getline
(
&
line
,
&
buf_len
,
hist
))
>=
0
)
{
if
(
read
>
0
&&
line
[
read
-
1
]
==
'\n'
)
{
read
--
;
line
[
read
]
=
'\0'
;
}
if
(
read
>
0
&&
line
[
read
-
1
]
==
'\n'
)
line
[
--
read
]
=
'\0'
;
if
(
read
>
0
)
{
unsunder
(
line
,
read
);
update_history
(
history
,
line
);
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
964c10db
...
...
@@ -534,9 +534,6 @@ void shortcut_init(void)
N_
(
"Copy the current line and store it in the cutbuffer"
);
const
char
*
nano_indent_msg
=
N_
(
"Indent the current line"
);
const
char
*
nano_unindent_msg
=
N_
(
"Unindent the current line"
);
#ifdef ENABLE_COMMENT
const
char
*
nano_comment_msg
=
N_
(
"Comment/uncomment the current line or marked lines"
);
#endif
const
char
*
nano_undo_msg
=
N_
(
"Undo the last operation"
);
const
char
*
nano_redo_msg
=
N_
(
"Redo the last undone operation"
);
#endif
...
...
@@ -597,6 +594,10 @@ void shortcut_init(void)
#ifdef ENABLE_WORDCOMPLETION
const
char
*
nano_completion_msg
=
N_
(
"Try and complete the current word"
);
#endif
#ifdef ENABLE_COMMENT
const
char
*
nano_comment_msg
=
N_
(
"Comment/uncomment the current line or marked lines"
);
#endif
#ifndef NANO_TINY
const
char
*
nano_savefile_msg
=
N_
(
"Save file without prompting"
);
const
char
*
nano_findprev_msg
=
N_
(
"Search next occurrence backward"
);
...
...
This diff is collapsed.
Click to expand it.
src/text.c
View file @
964c10db
...
...
@@ -1212,12 +1212,14 @@ void add_undo(undo_type action)
case
BACK
:
/* If the next line is the magic line, don't ever undo this
* backspace, as it won't actually have deleted anything. */
if
(
openfile
->
current
->
next
==
openfile
->
filebot
&&
openfile
->
current
->
data
[
0
]
!=
'\0'
)
if
(
openfile
->
current
->
next
==
openfile
->
filebot
&&
openfile
->
current
->
data
[
0
]
!=
'\0'
)
u
->
xflags
=
WAS_FINAL_BACKSPACE
;
case
DEL
:
if
(
u
->
begin
!=
strlen
(
openfile
->
current
->
data
))
{
char
*
char_buf
=
charalloc
(
mb_cur_max
()
+
1
);
int
char_buf_len
=
parse_mbchar
(
&
openfile
->
current
->
data
[
u
->
begin
],
char_buf
,
NULL
);
int
char_buf_len
=
parse_mbchar
(
&
openfile
->
current
->
data
[
u
->
begin
],
char_buf
,
NULL
);
null_at
(
&
char_buf
,
char_buf_len
);
u
->
strdata
=
char_buf
;
if
(
u
->
type
==
BACK
)
...
...
@@ -2288,8 +2290,7 @@ void do_justify(bool full_justify)
if
(
first_par_line
==
NULL
)
{
backup_lines
(
openfile
->
current
,
full_justify
?
openfile
->
filebot
->
lineno
-
openfile
->
current
->
lineno
+
((
openfile
->
filebot
->
data
[
0
]
!=
'\0'
)
?
1
:
0
)
:
par_len
);
((
openfile
->
filebot
->
data
[
0
]
!=
'\0'
)
?
1
:
0
)
:
par_len
);
first_par_line
=
openfile
->
current
;
}
...
...
@@ -2343,8 +2344,7 @@ void do_justify(bool full_justify)
/* We're just about to tack the next line onto this one. If
* this line isn't empty, make sure it ends in a space. */
if
(
line_len
>
0
&&
openfile
->
current
->
data
[
line_len
-
1
]
!=
' '
)
{
if
(
line_len
>
0
&&
openfile
->
current
->
data
[
line_len
-
1
]
!=
' '
)
{
line_len
++
;
openfile
->
current
->
data
=
charealloc
(
openfile
->
current
->
data
,
line_len
+
1
);
...
...
@@ -2359,8 +2359,7 @@ void do_justify(bool full_justify)
#ifndef NANO_TINY
/* If needed, adjust the coordinates of the mark. */
if
(
openfile
->
mark_set
&&
openfile
->
mark_begin
==
next_line
)
{
if
(
openfile
->
mark_set
&&
openfile
->
mark_begin
==
next_line
)
{
openfile
->
mark_begin
=
openfile
->
current
;
openfile
->
mark_begin_x
+=
line_len
-
indent_len
;
}
...
...
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