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
ef071255
Commit
ef071255
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
color: refresh the screen whenever the active syntax changes
This fixes
https://savannah.gnu.org/bugs/?47296
.
parent
afb6a5b8
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/files.c
+5
-7
src/files.c
with
5 additions
and
7 deletions
+5
-7
src/files.c
View file @
ef071255
...
...
@@ -2115,7 +2115,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
/* If we must set the filename, and it changed, adjust things. */
if
(
!
nonamechange
&&
strcmp
(
openfile
->
filename
,
realname
)
!=
0
)
{
#ifndef DISABLE_COLOR
char
*
syntax
name
=
openfile
->
syntax
?
openfile
->
syntax
->
name
:
""
;
char
*
old
name
=
openfile
->
syntax
?
openfile
->
syntax
->
name
:
""
;
filestruct
*
line
=
openfile
->
fileage
;
#endif
openfile
->
filename
=
mallocstrcpy
(
openfile
->
filename
,
realname
);
...
...
@@ -2125,19 +2125,17 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
color_update
();
color_init
();
char
*
newname
=
openfile
->
syntax
?
openfile
->
syntax
->
name
:
""
;
/* If the syntax changed, discard and recompute the multidata. */
if
(
openfile
->
syntax
&&
strcmp
(
syntaxname
,
openfile
->
syntax
->
name
)
!=
0
)
{
if
(
strcmp
(
oldname
,
newname
)
!=
0
)
{
for
(;
line
!=
NULL
;
line
=
line
->
next
)
{
free
(
line
->
multidata
);
line
->
multidata
=
NULL
;
}
precalc_multicolorinfo
();
refresh_needed
=
TRUE
;
}
/* If color syntaxes are available and turned on, refresh. */
if
(
openfile
->
colorstrings
!=
NULL
&&
!
ISSET
(
NO_COLOR_SYNTAX
))
edit_refresh
();
#endif
}
...
...
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