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
bb8d65e8
Commit
bb8d65e8
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle some code, and rename a variable
parent
f9bf320f
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+15
-17
src/winio.c
with
15 additions
and
17 deletions
+15
-17
src/winio.c
View file @
bb8d65e8
...
...
@@ -2003,7 +2003,7 @@ void titlebar(const char *path)
/* The width that "Modified" would take up. */
size_t
offset
=
0
;
/* The position at which the center part of the titlebar starts. */
const
char
*
branding
=
BRANDING
;
const
char
*
upperleft
=
""
;
/* What is shown in the top left corner. */
const
char
*
prefix
=
""
;
/* What is shown before the path -- "DIR:" or nothing. */
...
...
@@ -2029,24 +2029,22 @@ void titlebar(const char *path)
* first sacrifice the version string, then eat up the side spaces,
* then sacrifice the prefix, and only then start dottifying. */
/* When multiple buffers are open, show which one out of how many. */
if
(
path
==
NULL
&&
more_than_one
)
{
indicator
=
charalloc
(
24
);
sprintf
(
indicator
,
"[%i/%i]"
,
buffer_number
(
openfile
),
buffer_number
(
firstfile
->
prev
));
branding
=
indicator
;
}
/* Figure out the path, prefix and state strings. */
if
(
inhelp
)
branding
=
""
;
#ifdef ENABLE_BROWSER
else
if
(
path
!=
NULL
)
{
branding
=
""
;
if
(
!
inhelp
&&
path
!=
NULL
)
prefix
=
_
(
"DIR:"
);
}
else
#endif
else
{
if
(
!
inhelp
)
{
/* If there are/were multiple buffers, show which out of how many. */
if
(
more_than_one
)
{
indicator
=
charalloc
(
24
);
sprintf
(
indicator
,
"[%i/%i]"
,
buffer_number
(
openfile
),
buffer_number
(
firstfile
->
prev
));
upperleft
=
indicator
;
}
else
upperleft
=
BRANDING
;
if
(
openfile
->
filename
[
0
]
==
'\0'
)
path
=
_
(
"New Buffer"
);
else
...
...
@@ -2061,7 +2059,7 @@ void titlebar(const char *path)
}
/* Determine the widths of the four elements, including their padding. */
verlen
=
strlenpt
(
branding
)
+
3
;
verlen
=
strlenpt
(
upperleft
)
+
3
;
prefixlen
=
strlenpt
(
prefix
);
if
(
prefixlen
>
0
)
prefixlen
++
;
...
...
@@ -2074,7 +2072,7 @@ void titlebar(const char *path)
/* Only print the version message when there is room for it. */
if
(
verlen
+
prefixlen
+
pathlen
+
pluglen
+
statelen
<=
COLS
)
mvwaddstr
(
topwin
,
0
,
2
,
branding
);
mvwaddstr
(
topwin
,
0
,
2
,
upperleft
);
else
{
verlen
=
2
;
/* If things don't fit yet, give up the placeholder. */
...
...
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