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
0c2b54a2
Commit
0c2b54a2
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a function plus two parameters, to be more fitting
parent
a7f5907b
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/prompt.c
+4
-4
src/prompt.c
src/proto.h
+1
-1
src/proto.h
src/winio.c
+14
-15
src/winio.c
with
19 additions
and
20 deletions
+19
-20
src/prompt.c
View file @
0c2b54a2
...
...
@@ -700,20 +700,20 @@ int do_yesno_prompt(bool all, const char *msg)
/* Now show the ones for "Yes", "No", "Cancel" and maybe "All". */
sprintf
(
shortstr
,
" %c"
,
yesstr
[
0
]);
wmove
(
bottomwin
,
1
,
0
);
onekey
(
shortstr
,
_
(
"Yes"
),
width
);
post_
one
_
key
(
shortstr
,
_
(
"Yes"
),
width
);
if
(
all
)
{
shortstr
[
1
]
=
allstr
[
0
];
wmove
(
bottomwin
,
1
,
width
);
onekey
(
shortstr
,
_
(
"All"
),
width
);
post_
one
_
key
(
shortstr
,
_
(
"All"
),
width
);
}
shortstr
[
1
]
=
nostr
[
0
];
wmove
(
bottomwin
,
2
,
0
);
onekey
(
shortstr
,
_
(
"No"
),
width
);
post_
one
_
key
(
shortstr
,
_
(
"No"
),
width
);
wmove
(
bottomwin
,
2
,
width
);
onekey
(
"^C"
,
_
(
"Cancel"
),
width
);
post_
one
_
key
(
"^C"
,
_
(
"Cancel"
),
width
);
}
/* Color the statusbar over its full width and display the question. */
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
0c2b54a2
...
...
@@ -655,7 +655,7 @@ void statusbar(const char *msg);
void
warn_and_shortly_pause
(
const
char
*
msg
);
void
statusline
(
message_type
importance
,
const
char
*
msg
,
...);
void
bottombars
(
int
menu
);
void
onekey
(
const
char
*
keystroke
,
const
char
*
desc
,
int
leng
th
);
void
post_
one
_
key
(
const
char
*
keystroke
,
const
char
*
tag
,
int
wid
th
);
void
place_the_cursor
(
void
);
void
edit_draw
(
filestruct
*
fileptr
,
const
char
*
converted
,
int
line
,
size_t
from_col
);
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
0c2b54a2
...
...
@@ -2336,7 +2336,7 @@ void bottombars(int menu)
wmove
(
bottomwin
,
1
+
i
%
2
,
(
i
/
2
)
*
itemwidth
);
onekey
(
s
->
keystr
,
_
(
f
->
desc
),
itemwidth
+
(
COLS
%
itemwidth
));
post_
one
_
key
(
s
->
keystr
,
_
(
f
->
desc
),
itemwidth
+
(
COLS
%
itemwidth
));
i
++
;
}
...
...
@@ -2345,25 +2345,24 @@ void bottombars(int menu)
wrefresh
(
bottomwin
);
}
/* Write a shortcut key to the help area at the bottom of the window.
* keystroke is e.g. "^G" and desc is e.g. "Get Help". We are careful
* to write at most length characters, even if length is very small and
* keystroke and desc are long. Note that waddnstr(,,(size_t)-1) adds
* the whole string! We do not bother padding the entry with blanks. */
void
onekey
(
const
char
*
keystroke
,
const
char
*
desc
,
int
length
)
/* Write a key's representation plus a minute description of its function
* to the screen. For example, the key could be "^C" and its tag "Cancel".
* Key plus tag may occupy at most width columns. */
void
post_one_key
(
const
char
*
keystroke
,
const
char
*
tag
,
int
width
)
{
wattron
(
bottomwin
,
interface_color_pair
[
KEY_COMBO
]);
waddnstr
(
bottomwin
,
keystroke
,
actual_x
(
keystroke
,
leng
th
));
waddnstr
(
bottomwin
,
keystroke
,
actual_x
(
keystroke
,
wid
th
));
wattroff
(
bottomwin
,
interface_color_pair
[
KEY_COMBO
]);
length
-=
strlenpt
(
keystroke
)
+
1
;
/* If the remaning space is too small, skip the description. */
width
-=
strlenpt
(
keystroke
);
if
(
width
<
2
)
return
;
if
(
length
>
0
)
{
waddch
(
bottomwin
,
' '
);
wattron
(
bottomwin
,
interface_color_pair
[
FUNCTION_TAG
]);
waddnstr
(
bottomwin
,
desc
,
actual_x
(
desc
,
length
));
wattroff
(
bottomwin
,
interface_color_pair
[
FUNCTION_TAG
]);
}
waddch
(
bottomwin
,
' '
);
wattron
(
bottomwin
,
interface_color_pair
[
FUNCTION_TAG
]);
waddnstr
(
bottomwin
,
tag
,
actual_x
(
tag
,
width
-
1
));
wattroff
(
bottomwin
,
interface_color_pair
[
FUNCTION_TAG
]);
}
/* Redetermine current_y from the position of current relative to edittop,
...
...
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