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
1e2d9a69
Commit
1e2d9a69
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a constant, to match the corresponding option
parent
63c428ad
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
src/cut.c
+1
-1
src/cut.c
src/global.c
+3
-3
src/global.c
src/nano.c
+2
-2
src/nano.c
src/nano.h
+1
-1
src/nano.h
src/prompt.c
+1
-1
src/prompt.c
src/rcfile.c
+2
-2
src/rcfile.c
src/text.c
+2
-2
src/text.c
with
12 additions
and
12 deletions
+12
-12
src/cut.c
View file @
1e2d9a69
...
...
@@ -155,7 +155,7 @@ void do_cut_text(bool copy_text, bool cut_till_eof)
/* Move the marked text to the cutbuffer, and turn the mark off. */
cut_marked
(
&
right_side_up
);
openfile
->
mark_set
=
FALSE
;
}
else
if
(
ISSET
(
CUT_
TO_END
))
}
else
if
(
ISSET
(
CUT_
FROM_CURSOR
))
/* Move all text up to the end of the line into the cutbuffer. */
cut_to_eol
();
else
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
1e2d9a69
...
...
@@ -1204,7 +1204,7 @@ void shortcut_init(void)
/* Group of "Editing-behavior" toggles. */
add_to_sclist
(
MMAIN
,
"M-H"
,
0
,
do_toggle_void
,
SMART_HOME
);
add_to_sclist
(
MMAIN
,
"M-I"
,
0
,
do_toggle_void
,
AUTOINDENT
);
add_to_sclist
(
MMAIN
,
"M-K"
,
0
,
do_toggle_void
,
CUT_
TO_END
);
add_to_sclist
(
MMAIN
,
"M-K"
,
0
,
do_toggle_void
,
CUT_
FROM_CURSOR
);
#ifndef DISABLE_WRAPPING
add_to_sclist
(
MMAIN
,
"M-L"
,
0
,
do_toggle_void
,
NO_WRAP
);
#endif
...
...
@@ -1376,7 +1376,7 @@ const char *flagtostr(int flag)
return
N_
(
"Smart home key"
);
case
AUTOINDENT
:
return
N_
(
"Auto indent"
);
case
CUT_
TO_END
:
case
CUT_
FROM_CURSOR
:
return
N_
(
"Cut to end"
);
case
NO_WRAP
:
return
N_
(
"Hard wrapping of overlong lines"
);
...
...
@@ -1635,7 +1635,7 @@ sc *strtosc(const char *input)
else
if
(
!
strcasecmp
(
input
,
"autoindent"
))
s
->
toggle
=
AUTOINDENT
;
else
if
(
!
strcasecmp
(
input
,
"cuttoend"
))
s
->
toggle
=
CUT_
TO_END
;
s
->
toggle
=
CUT_
FROM_CURSOR
;
#ifndef DISABLE_WRAPPING
else
if
(
!
strcasecmp
(
input
,
"nowrap"
))
s
->
toggle
=
NO_WRAP
;
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
1e2d9a69
...
...
@@ -1687,7 +1687,7 @@ int do_input(bool allow_funcs)
#ifndef NANO_TINY
if
(
s
->
scfunc
==
do_toggle_void
)
{
do_toggle
(
s
->
toggle
);
if
(
s
->
toggle
!=
CUT_
TO_END
)
if
(
s
->
toggle
!=
CUT_
FROM_CURSOR
)
preserve
=
TRUE
;
}
else
#endif
...
...
@@ -2150,7 +2150,7 @@ int main(int argc, char **argv)
SET
(
AUTOINDENT
);
break
;
case
'k'
:
SET
(
CUT_
TO_END
);
SET
(
CUT_
FROM_CURSOR
);
break
;
#endif
#ifdef ENABLE_MOUSE
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
1e2d9a69
...
...
@@ -489,7 +489,7 @@ enum
USE_MOUSE
,
USE_REGEXP
,
TEMP_FILE
,
CUT_
TO_END
,
CUT_
FROM_CURSOR
,
BACKWARDS_SEARCH
,
MULTIBUFFER
,
SMOOTH_SCROLL
,
...
...
This diff is collapsed.
Click to expand it.
src/prompt.c
View file @
1e2d9a69
...
...
@@ -291,7 +291,7 @@ void do_statusbar_delete(void)
/* Zap some or all text from the answer. */
void
do_statusbar_cut_text
(
void
)
{
if
(
!
ISSET
(
CUT_
TO_END
))
if
(
!
ISSET
(
CUT_
FROM_CURSOR
))
statusbar_x
=
0
;
answer
[
statusbar_x
]
=
'\0'
;
...
...
This diff is collapsed.
Click to expand it.
src/rcfile.c
View file @
1e2d9a69
...
...
@@ -96,8 +96,8 @@ static const rcoption rcopts[] = {
{
"backupdir"
,
0
},
{
"backwards"
,
BACKWARDS_SEARCH
},
{
"casesensitive"
,
CASE_SENSITIVE
},
{
"cut"
,
CUT_
TO_END
},
/* deprecated form, remove in 2020 */
{
"cutfromcursor"
,
CUT_
TO_END
},
{
"cut"
,
CUT_
FROM_CURSOR
},
/* deprecated form, remove in 2020 */
{
"cutfromcursor"
,
CUT_
FROM_CURSOR
},
{
"justifytrim"
,
JUSTIFY_TRIM
},
{
"locking"
,
LOCKING
},
{
"matchbrackets"
,
0
},
...
...
This diff is collapsed.
Click to expand it.
src/text.c
View file @
1e2d9a69
...
...
@@ -1270,7 +1270,7 @@ void add_undo(undo_type action)
u
->
mark_begin_lineno
=
openfile
->
mark_begin
->
lineno
;
u
->
mark_begin_x
=
openfile
->
mark_begin_x
;
u
->
xflags
=
MARK_WAS_SET
;
}
else
if
(
!
ISSET
(
CUT_
TO_END
))
{
}
else
if
(
!
ISSET
(
CUT_
FROM_CURSOR
))
{
/* The entire line is being cut regardless of the cursor position. */
u
->
begin
=
0
;
u
->
xflags
=
WAS_WHOLE_LINE
;
...
...
@@ -1423,7 +1423,7 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf
u
->
cutbottom
=
u
->
cutbottom
->
next
;
u
->
lineno
=
u
->
mark_begin_lineno
+
u
->
cutbottom
->
lineno
-
u
->
cutbuffer
->
lineno
;
if
(
ISSET
(
CUT_
TO_END
)
||
u
->
type
==
CUT_EOF
)
{
if
(
ISSET
(
CUT_
FROM_CURSOR
)
||
u
->
type
==
CUT_EOF
)
{
u
->
begin
=
strlen
(
u
->
cutbottom
->
data
);
if
(
u
->
lineno
==
u
->
mark_begin_lineno
)
u
->
begin
+=
u
->
mark_begin_x
;
...
...
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