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
afb6a5b8
Commit
afb6a5b8
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
color: forget about aborting the precalculation for multiline regexes
This fixes
https://savannah.gnu.org/bugs/?48389
.
parent
a37cd9f0
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/color.c
+0
-31
src/color.c
with
0 additions
and
31 deletions
+0
-31
src/color.c
View file @
afb6a5b8
...
...
@@ -396,23 +396,6 @@ void alloc_multidata_if_needed(filestruct *fileptr)
}
}
/* Poll the keyboard every second to see if the user starts typing. */
bool
key_was_pressed
(
void
)
{
static
time_t
last_time
=
0
;
int
onebyte
;
if
(
time
(
NULL
)
!=
last_time
)
{
last_time
=
time
(
NULL
);
onebyte
=
wgetch
(
edit
);
if
(
onebyte
==
ERR
)
return
FALSE
;
ungetch
(
onebyte
);
return
TRUE
;
}
else
return
FALSE
;
}
/* Precalculate the multi-line start and end regex info so we can
* speed up rendering (with any hope at all...). */
void
precalc_multicolorinfo
(
void
)
...
...
@@ -427,11 +410,6 @@ void precalc_multicolorinfo(void)
#ifdef DEBUG
fprintf
(
stderr
,
"Entering precalculation of multiline color info
\n
"
);
#endif
/* Let us get keypresses to see if the user is trying to start
* editing. Later we may want to throw up a statusbar message
* before starting this if it takes too long to do this routine.
* For now silently abort if they hit a key. */
nodelay
(
edit
,
TRUE
);
for
(
ink
=
openfile
->
colorstrings
;
ink
!=
NULL
;
ink
=
ink
->
next
)
{
/* If this is not a multi-line regex, skip it. */
...
...
@@ -443,9 +421,6 @@ void precalc_multicolorinfo(void)
for
(
fileptr
=
openfile
->
fileage
;
fileptr
!=
NULL
;
fileptr
=
fileptr
->
next
)
{
int
startx
=
0
,
nostart
=
0
;
if
(
key_was_pressed
())
goto
precalc_cleanup
;
#ifdef DEBUG
fprintf
(
stderr
,
"working on lineno %ld... "
,
(
long
)
fileptr
->
lineno
);
#endif
...
...
@@ -479,10 +454,6 @@ void precalc_multicolorinfo(void)
#ifdef DEBUG
fprintf
(
stderr
,
"
\n
advancing to line %ld to find end... "
,
(
long
)
endptr
->
lineno
);
#endif
/* Check for interrupting keyboard input again. */
if
(
key_was_pressed
())
goto
precalc_cleanup
;
if
(
regexec
(
ink
->
end
,
endptr
->
data
,
1
,
&
endmatch
,
0
)
==
0
)
break
;
}
...
...
@@ -531,8 +502,6 @@ void precalc_multicolorinfo(void)
}
}
}
precalc_cleanup:
nodelay
(
edit
,
FALSE
);
}
#endif
/* !DISABLE_COLOR */
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