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
f74a1208
Commit
f74a1208
authored
6 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: refer to the magic line as "magic line", not as "magicline"
parent
911eb0cf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
src/cut.c
+2
-2
src/cut.c
src/files.c
+3
-5
src/files.c
src/nano.c
+3
-3
src/nano.c
src/search.c
+1
-1
src/search.c
src/text.c
+1
-1
src/text.c
src/utils.c
+2
-2
src/utils.c
with
12 additions
and
14 deletions
+12
-14
src/cut.c
View file @
f74a1208
...
...
@@ -309,7 +309,7 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
cb_save
=
cutbottom
;
cb_save_len
=
strlen
(
cutbottom
->
data
);
}
/* Don't add a magicline when moving text to the cutbuffer. */
/* Don't add a magic
line when moving text to the cutbuffer. */
SET
(
NO_NEWLINES
);
}
...
...
@@ -346,7 +346,7 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
if
(
right_side_up
)
openfile
->
placewewant
=
xplustabs
();
}
/* Restore the magicline behavior now that we're done fiddling. */
/* Restore the magic
-
line behavior now that we're done fiddling. */
if
(
!
old_no_newlines
)
UNSET
(
NO_NEWLINES
);
}
else
...
...
This diff is collapsed.
Click to expand it.
src/files.c
View file @
f74a1208
...
...
@@ -565,7 +565,7 @@ void replace_marked_buffer(const char *filename)
if
(
descriptor
<
0
)
return
;
/* Don't add a magicline when replacing text in the buffer. */
/* Don't add a magic
line when replacing text in the buffer. */
SET
(
NO_NEWLINES
);
add_undo
(
COUPLE_BEGIN
);
...
...
@@ -582,7 +582,7 @@ void replace_marked_buffer(const char *filename)
/* Insert the processed file where the marked text was. */
read_file
(
f
,
descriptor
,
filename
,
TRUE
);
/* Restore the magicline behavior now that we're done fiddling. */
/* Restore the magic
-
line behavior now that we're done fiddling. */
if
(
!
old_no_newlines
)
UNSET
(
NO_NEWLINES
);
...
...
@@ -2049,7 +2049,6 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp,
{
bool
retval
;
bool
added_magicline
=
FALSE
;
/* Whether we added a magicline after filebot. */
filestruct
*
top
,
*
bot
;
size_t
top_x
,
bot_x
;
...
...
@@ -2058,7 +2057,7 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp,
(
const
filestruct
**
)
&
bot
,
&
bot_x
,
NULL
);
filepart
=
partition_filestruct
(
top
,
top_x
,
bot
,
bot_x
);
/* If we are
do
ing magicline, and the last line of the partition
/* If we are
us
ing
a
magic
line, and the last line of the partition
* isn't blank, then add a newline at the end of the buffer. */
if
(
!
ISSET
(
NO_NEWLINES
)
&&
openfile
->
filebot
->
data
[
0
]
!=
'\0'
)
{
new_magicline
();
...
...
@@ -2067,7 +2066,6 @@ bool write_marked_file(const char *name, FILE *f_open, bool tmp,
retval
=
write_file
(
name
,
f_open
,
tmp
,
method
,
FALSE
);
/* If we added a magicline, remove it now. */
if
(
added_magicline
)
remove_magicline
();
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
f74a1208
...
...
@@ -392,7 +392,7 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot,
/* Renumber, starting with the beginning line of the old partition. */
renumber
(
top_save
);
/* If the text doesn't end with a
magic
line, and it should, add one. */
/* If the text doesn't end with a
new
line, and it should, add one. */
if
(
!
ISSET
(
NO_NEWLINES
)
&&
openfile
->
filebot
->
data
[
0
]
!=
'\0'
)
new_magicline
();
}
...
...
@@ -489,7 +489,7 @@ void ingraft_buffer(filestruct *somebuffer)
/* Renumber, starting with the beginning line of the old partition. */
renumber
(
top_save
);
/* If the text doesn't end with a
magic
line, and it should, add one. */
/* If the text doesn't end with a
new
line, and it should, add one. */
if
(
!
ISSET
(
NO_NEWLINES
)
&&
openfile
->
filebot
->
data
[
0
]
!=
'\0'
)
new_magicline
();
}
...
...
@@ -1902,7 +1902,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
update_undo
(
ADD
);
#endif
/* If we've added text to the magicline, create a new magicline. */
/* If we've added text to the magic
line, create a new magic
line. */
if
(
openfile
->
filebot
==
openfile
->
current
&&
!
ISSET
(
NO_NEWLINES
))
{
new_magicline
();
if
(
margin
>
0
)
...
...
This diff is collapsed.
Click to expand it.
src/search.c
View file @
f74a1208
...
...
@@ -680,7 +680,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
#endif
/* If "automatic newline" is enabled, and text has been added to the
* magicline, make a new magicline. */
* magic
line, make a new magic
line. */
if
(
!
ISSET
(
NO_NEWLINES
)
&&
openfile
->
filebot
->
data
[
0
]
!=
'\0'
)
new_magicline
();
...
...
This diff is collapsed.
Click to expand it.
src/text.c
View file @
f74a1208
...
...
@@ -479,7 +479,7 @@ void undo_cut(undo *u)
copy_from_buffer
(
u
->
cutbuffer
);
/* If the final line was originally cut, remove the extra magicline. */
/* If the final line was originally cut, remove the extra magic
line. */
if
((
u
->
xflags
&
WAS_FINAL_LINE
)
&&
!
ISSET
(
NO_NEWLINES
)
&&
openfile
->
current
!=
openfile
->
filebot
)
remove_magicline
();
...
...
This diff is collapsed.
Click to expand it.
src/utils.c
View file @
f74a1208
...
...
@@ -437,7 +437,7 @@ size_t strlenpt(const char *text)
return
span
;
}
/* Append a new magicline to the end of the buffer. */
/* Append a new magic
line to the end of the buffer. */
void
new_magicline
(
void
)
{
openfile
->
filebot
->
next
=
make_new_node
(
openfile
->
filebot
);
...
...
@@ -447,7 +447,7 @@ void new_magicline(void)
}
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
/* Remove the magicline from the end of the buffer, if there is one and
/* Remove the magic
line from the end of the buffer, if there is one and
* it isn't the only line in the file. */
void
remove_magicline
(
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