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
9d6d5b67
Commit
9d6d5b67
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
screen: rename a variable, because 'disable' sounds too permanent
parent
f1b9ba27
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
+12
-15
src/winio.c
with
12 additions
and
15 deletions
+12
-15
src/winio.c
View file @
9d6d5b67
...
...
@@ -36,7 +36,7 @@ static size_t key_buffer_len = 0;
static
int
statusblank
=
0
;
/* The number of keystrokes left after we call statusbar(),
* before we actually blank the statusbar. */
static
bool
disable
_cursorpos
=
FALSE
;
static
bool
suppress
_cursorpos
=
FALSE
;
/* Should we temporarily disable constant cursor position
* display? */
static
bool
seen_wide
=
FALSE
;
...
...
@@ -2079,7 +2079,7 @@ void titlebar(const char *path)
wnoutrefresh
(
edit
);
}
/* Display a message on the statusbar, and set
disable
_cursorpos to
/* Display a message on the statusbar, and set
suppress
_cursorpos to
* TRUE, so that the message won't be immediately overwritten if
* constant cursor position display is on. */
void
statusbar
(
const
char
*
msg
,
...)
...
...
@@ -2133,7 +2133,7 @@ void statusbar(const char *msg, ...)
wnoutrefresh
(
bottomwin
);
disable
_cursorpos
=
TRUE
;
suppress
_cursorpos
=
TRUE
;
/* Push the message to the screen straightaway. */
doupdate
();
...
...
@@ -3085,11 +3085,8 @@ void display_main_list(void)
}
/* If constant is TRUE, we display the current cursor position only if
* disable_cursorpos is FALSE. Otherwise, we display it
* unconditionally and set disable_cursorpos to FALSE. If constant is
* TRUE and disable_cursorpos is TRUE, we also set disable_cursorpos to
* FALSE, so that we leave the current statusbar alone this time, and
* display the current cursor position next time. */
* suppress_cursorpos is FALSE. If constant is FALSE, we display the
* position always. In any case we reset suppress_cursorpos to FALSE. */
void
do_cursorpos
(
bool
constant
)
{
filestruct
*
f
;
...
...
@@ -3100,6 +3097,7 @@ void do_cursorpos(bool constant)
assert
(
openfile
->
fileage
!=
NULL
&&
openfile
->
current
!=
NULL
);
/* Determine the size of the file up to the cursor. */
f
=
openfile
->
current
->
next
;
c
=
openfile
->
current
->
data
[
openfile
->
current_x
];
...
...
@@ -3111,13 +3109,14 @@ void do_cursorpos(bool constant)
openfile
->
current
->
data
[
openfile
->
current_x
]
=
c
;
openfile
->
current
->
next
=
f
;
if
(
constant
&&
disable_cursorpos
)
{
disable_cursorpos
=
FALSE
;
return
;
/* If the position needs to be suppressed, don't suppress it next time. */
if
(
suppress_cursorpos
)
{
suppress_cursorpos
=
FALSE
;
if
(
constant
)
return
;
}
/* Display the current cursor position on the statusbar, and set
* disable_cursorpos to FALSE. */
/* Display the current cursor position on the statusbar. */
linepct
=
100
*
openfile
->
current
->
lineno
/
openfile
->
filebot
->
lineno
;
colpct
=
100
*
cur_xpt
/
cur_lenpt
;
charpct
=
(
openfile
->
totsize
==
0
)
?
0
:
100
*
i
/
openfile
->
totsize
;
...
...
@@ -3128,8 +3127,6 @@ void do_cursorpos(bool constant)
(
long
)
openfile
->
filebot
->
lineno
,
linepct
,
(
unsigned
long
)
cur_xpt
,
(
unsigned
long
)
cur_lenpt
,
colpct
,
(
unsigned
long
)
i
,
(
unsigned
long
)
openfile
->
totsize
,
charpct
);
disable_cursorpos
=
FALSE
;
}
/* Unconditionally display the current cursor position. */
...
...
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