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
0378146a
Commit
0378146a
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a variable, drop a false assert, and reshuffle a bit
parent
6e9d6a08
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
+9
-8
src/winio.c
with
9 additions
and
8 deletions
+9
-8
src/winio.c
View file @
0378146a
...
...
@@ -3100,16 +3100,17 @@ void disable_nodelay(void)
* expect word to have tabs and control characters expanded. */
void
spotlight
(
bool
active
,
const
char
*
word
)
{
size_t
word_len
=
strlenpt
(
word
),
room
=
word_len
;
size_t
word_span
=
strlenpt
(
word
);
size_t
room
=
word_span
;
/* Compute the number of columns that are available for the word. */
if
(
!
ISSET
(
SOFTWRAP
))
if
(
!
ISSET
(
SOFTWRAP
))
{
room
=
editwincols
+
get_page_start
(
xplustabs
())
-
xplustabs
();
assert
(
room
>
0
);
if
(
word_len
>
room
)
room
--
;
/* If the word is partially offscreen, reserve space for the "$". */
if
(
word_span
>
room
)
room
--
;
}
reset_cursor
();
...
...
@@ -3117,12 +3118,12 @@ void spotlight(bool active, const char *word)
wattron
(
edit
,
hilite_attribute
);
/* This is so we can show zero-length matches. */
if
(
word_
le
n
==
0
)
if
(
word_
spa
n
==
0
)
waddch
(
edit
,
' '
);
else
waddnstr
(
edit
,
word
,
actual_x
(
word
,
room
));
if
(
word_
le
n
>
room
)
if
(
word_
spa
n
>
room
)
waddch
(
edit
,
'$'
);
if
(
active
)
...
...
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