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
911eb0cf
Commit
911eb0cf
authored
6 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename and invert a function, to avoid double negatives
parent
67873e96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cut.c
+8
-8
src/cut.c
src/proto.h
+1
-1
src/proto.h
with
9 additions
and
9 deletions
+9
-9
src/cut.c
View file @
911eb0cf
...
...
@@ -203,7 +203,7 @@ void do_cut_prev_word(void)
/* Delete a word rightward. */
void
do_cut_next_word
(
void
)
{
if
(
!
nothing_need
s_cutt
ing
(
openfile
->
current_x
>
0
))
if
(
i
s_cutt
able
(
openfile
->
current_x
>
0
))
do_cutword
(
FALSE
);
}
#endif
/* !NANO_TINY */
...
...
@@ -356,10 +356,10 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
refresh_needed
=
TRUE
;
}
/* Return
TRU
E when a cut command would not actually cut anything: when
/* Return
FALS
E when a cut command would not actually cut anything: when
* on an empty line at EOF, or when the mark covers zero characters, or
* (when test_cliff is TRUE) when the magic line would be cut. */
bool
nothing_need
s_cutt
ing
(
bool
test_cliff
)
bool
i
s_cutt
able
(
bool
test_cliff
)
{
if
((
openfile
->
current
->
next
==
NULL
&&
openfile
->
current
->
data
[
0
]
==
'\0'
#ifndef NANO_TINY
...
...
@@ -375,16 +375,16 @@ bool nothing_needs_cutting(bool test_cliff)
openfile
->
mark
=
NULL
;
#endif
statusbar
(
_
(
"Nothing was cut"
));
return
TRUE
;
}
else
return
FALSE
;
}
else
return
TRUE
;
}
/* Move text from the current buffer into the cutbuffer. */
void
do_cut_text_void
(
void
)
{
#ifndef NANO_TINY
if
(
nothing_need
s_cutt
ing
(
ISSET
(
CUT_FROM_CURSOR
)
&&
openfile
->
mark
==
NULL
))
if
(
!
i
s_cutt
able
(
ISSET
(
CUT_FROM_CURSOR
)
&&
openfile
->
mark
==
NULL
))
return
;
/* Only add a new undo item when the current item is not a CUT or when
...
...
@@ -396,7 +396,7 @@ void do_cut_text_void(void)
do_cut_text
(
FALSE
,
openfile
->
mark
,
FALSE
,
FALSE
);
update_undo
(
CUT
);
#else
if
(
!
nothing_need
s_cutt
ing
(
FALSE
))
if
(
i
s_cutt
able
(
FALSE
))
do_cut_text
(
FALSE
,
FALSE
,
FALSE
,
FALSE
);
#endif
}
...
...
@@ -455,7 +455,7 @@ void zap_text(void)
filestruct
*
was_cutbuffer
=
cutbuffer
;
filestruct
*
was_cutbottom
=
cutbottom
;
if
(
nothing_need
s_cutt
ing
(
ISSET
(
CUT_FROM_CURSOR
)
&&
openfile
->
mark
==
NULL
))
if
(
!
i
s_cutt
able
(
ISSET
(
CUT_FROM_CURSOR
)
&&
openfile
->
mark
==
NULL
))
return
;
/* Add a new undo item only when the current item is not a ZAP or when
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
911eb0cf
...
...
@@ -251,7 +251,7 @@ void do_cut_next_word(void);
void
cut_marked
(
bool
*
right_side_up
);
#endif
void
do_cut_text
(
bool
copy_text
,
bool
marked
,
bool
cut_till_eof
,
bool
append
);
bool
nothing_need
s_cutt
ing
(
bool
test_cliff
);
bool
i
s_cutt
able
(
bool
test_cliff
);
void
do_cut_text_void
(
void
);
#ifndef NANO_TINY
void
do_copy_text
(
void
);
...
...
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