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
bf1a0809
Commit
bf1a0809
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
build: exclude more things when configured with --disable-multibuffer
This will make the tiny version slightly smaller.
parent
b7f8d481
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
src/files.c
+4
-1
src/files.c
src/global.c
+2
-0
src/global.c
src/nano.c
+4
-1
src/nano.c
src/nano.h
+2
-0
src/nano.h
src/proto.h
+2
-0
src/proto.h
src/text.c
+3
-3
src/text.c
src/winio.c
+4
-0
src/winio.c
with
21 additions
and
5 deletions
+21
-5
src/files.c
View file @
bf1a0809
...
...
@@ -66,16 +66,19 @@ void make_new_buffer(void)
if
(
openfile
==
NULL
)
{
/* Make the first open file the only element in the list. */
#ifdef ENABLE_MULTIBUFFER
newnode
->
prev
=
newnode
;
newnode
->
next
=
newnode
;
#endif
firstfile
=
newnode
;
}
else
{
/* Add the new open file after the current one in the list. */
#ifdef ENABLE_MULTIBUFFER
newnode
->
prev
=
openfile
;
newnode
->
next
=
openfile
->
next
;
openfile
->
next
->
prev
=
newnode
;
openfile
->
next
=
newnode
;
#endif
/* There is more than one file open: show "Close" in help lines. */
exitfunc
->
desc
=
close_tag
;
more_than_one
=
!
inhelp
||
more_than_one
;
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
bf1a0809
...
...
@@ -1779,12 +1779,14 @@ void thanks_for_all_the_fish(void)
free
(
alt_speller
);
#endif
free_filestruct
(
cutbuffer
);
#ifdef ENABLE_MULTIBUFFER
/* Free the memory associated with each open file buffer. */
while
(
openfile
!=
openfile
->
next
)
{
openfile
=
openfile
->
next
;
delete_opennode
(
openfile
->
prev
);
}
delete_opennode
(
openfile
);
#endif
#ifdef ENABLE_COLOR
free
(
syntaxstr
);
while
(
syntaxes
!=
NULL
)
{
...
...
This diff is collapsed.
Click to expand it.
src/nano.c
View file @
bf1a0809
...
...
@@ -512,17 +512,19 @@ openfilestruct *make_new_opennode(void)
return
(
openfilestruct
*
)
nmalloc
(
sizeof
(
openfilestruct
));
}
#ifdef ENABLE_MULTIBUFFER
/* Unlink a node from the rest of the circular list, and delete it. */
void
unlink_opennode
(
openfilestruct
*
fileptr
)
{
assert
(
fileptr
!=
fileptr
->
prev
&&
fileptr
!=
fileptr
->
next
);
#ifdef ENABLE_MULTIBUFFER
if
(
fileptr
==
firstfile
)
firstfile
=
firstfile
->
next
;
fileptr
->
prev
->
next
=
fileptr
->
next
;
fileptr
->
next
->
prev
=
fileptr
->
prev
;
#endif
delete_opennode
(
fileptr
);
}
...
...
@@ -539,6 +541,7 @@ void delete_opennode(openfilestruct *fileptr)
#endif
free
(
fileptr
);
}
#endif
/* Display a warning about a key disabled in view mode. */
void
print_view_warning
(
void
)
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
bf1a0809
...
...
@@ -408,10 +408,12 @@ typedef struct openfilestruct {
colortype
*
colorstrings
;
/* The file's associated colors. */
#endif
#ifdef ENABLE_MULTIBUFFER
struct
openfilestruct
*
next
;
/* The next open file, if any. */
struct
openfilestruct
*
prev
;
/* The preceding open file, if any. */
#endif
}
openfilestruct
;
#ifdef ENABLE_NANORC
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
bf1a0809
...
...
@@ -410,8 +410,10 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot,
void
ingraft_buffer
(
filestruct
*
somebuffer
);
void
copy_from_buffer
(
filestruct
*
somebuffer
);
openfilestruct
*
make_new_opennode
(
void
);
#ifdef ENABLE_MULTIBUFFER
void
unlink_opennode
(
openfilestruct
*
fileptr
);
void
delete_opennode
(
openfilestruct
*
fileptr
);
#endif
void
print_view_warning
(
void
);
void
show_restricted_warning
(
void
);
#ifndef ENABLE_HELP
...
...
This diff is collapsed.
Click to expand it.
src/text.c
View file @
bf1a0809
...
...
@@ -3200,7 +3200,7 @@ void do_linter(void)
functionptrtype
func
;
if
(
tmplint
!=
curlint
)
{
#if
n
def NA
NO_TINY
#ifdef
E
NA
BLE_MULTIBUFFER
struct
stat
lintfileinfo
;
new_lint_loop:
...
...
@@ -3265,7 +3265,7 @@ void do_linter(void)
openfile
=
tmpof
;
}
}
#endif
/*
!
NA
NO_TINY
*/
#endif
/*
E
NA
BLE_MULTIBUFFER
*/
goto_line_posx
(
curlint
->
lineno
,
curlint
->
colno
-
1
);
titlebar
(
NULL
);
adjust_viewport
(
CENTERING
);
...
...
@@ -3307,7 +3307,7 @@ void do_linter(void)
wipe_statusbar
();
#if
n
def NA
NO_TINY
#ifdef
E
NA
BLE_MULTIBUFFER
free_lints_and_return:
#endif
for
(
curlint
=
lints
;
curlint
!=
NULL
;)
{
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
bf1a0809
...
...
@@ -1973,6 +1973,7 @@ char *display_string(const char *buf, size_t column, size_t span, bool isdata)
return
converted
;
}
#ifdef ENABLE_MULTIBUFFER
/* Determine the sequence number of the given buffer in the circular list. */
int
buffer_number
(
openfilestruct
*
buffer
)
{
...
...
@@ -1985,6 +1986,7 @@ int buffer_number(openfilestruct *buffer)
return
count
;
}
#endif
/* If path is NULL, we're in normal editing mode, so display the current
* version of nano, the current filename, and whether the current file
...
...
@@ -2030,6 +2032,7 @@ void titlebar(const char *path)
else
#endif
if
(
!
inhelp
)
{
#ifdef ENABLE_MULTIBUFFER
/* If there are/were multiple buffers, show which out of how many. */
if
(
more_than_one
)
{
indicator
=
charalloc
(
24
);
...
...
@@ -2037,6 +2040,7 @@ void titlebar(const char *path)
buffer_number
(
firstfile
->
prev
));
upperleft
=
indicator
;
}
else
#endif
upperleft
=
BRANDING
;
if
(
openfile
->
filename
[
0
]
==
'\0'
)
...
...
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