Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
fbb3da77
Commit
fbb3da77
authored
Sep 21, 2010
by
Stefan Monnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/syntax.c (back_comment): Detect the case where a 1-char comment
starter is also the 2nd char of a 2-char comment ender.
parent
c9805d23
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
src/ChangeLog
src/ChangeLog
+5
-0
src/syntax.c
src/syntax.c
+7
-4
No files found.
src/ChangeLog
View file @
fbb3da77
2010-09-21 Stefan Monnier <monnier@iro.umontreal.ca>
* syntax.c (back_comment): Detect the case where a 1-char comment
starter is also the 2nd char of a 2-char comment ender.
2010-09-17 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (xg_tool_bar_menu_proxy): Set gtk-menu-items to TRUE.
...
...
src/syntax.c
View file @
fbb3da77
...
...
@@ -512,6 +512,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p
{
int
temp_byte
,
prev_syntax
;
int
com2start
,
com2end
;
int
comstart
;
/* Move back and examine a character. */
DEC_BOTH
(
from
,
from_byte
);
...
...
@@ -530,6 +531,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p
||
SYNTAX_FLAGS_COMMENT_NESTED
(
syntax
))
==
comnested
);
com2end
=
(
SYNTAX_FLAGS_COMEND_FIRST
(
syntax
)
&&
SYNTAX_FLAGS_COMEND_SECOND
(
prev_syntax
));
comstart
=
(
com2start
||
code
==
Scomment
);
/* Nasty cases with overlapping 2-char comment markers:
- snmp-mode: -- c -- foo -- c --
...
...
@@ -541,15 +543,16 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p
/// */
/* If a 2-char comment sequence partly overlaps with another,
we don't try to be clever. */
if
(
from
>
stop
&&
(
com2end
||
com2start
))
we don't try to be clever. E.g. |*| in C, or }% in modes that
have %..\n and %{..}%. */
if
(
from
>
stop
&&
(
com2end
||
comstart
))
{
int
next
=
from
,
next_byte
=
from_byte
,
next_c
,
next_syntax
;
DEC_BOTH
(
next
,
next_byte
);
UPDATE_SYNTAX_TABLE_BACKWARD
(
next
);
next_c
=
FETCH_CHAR_AS_MULTIBYTE
(
next_byte
);
next_syntax
=
SYNTAX_WITH_FLAGS
(
next_c
);
if
(((
com
2
start
||
comnested
)
if
(((
comstart
||
comnested
)
&&
SYNTAX_FLAGS_COMEND_SECOND
(
syntax
)
&&
SYNTAX_FLAGS_COMEND_FIRST
(
next_syntax
))
||
((
com2end
||
comnested
)
...
...
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