Discussion:
[Help] Start and End of Languages/Lexers
Stefano Mtangoo
2013-10-30 09:55:38 UTC
Permalink
am not sure if the heading is correct, if not then help me frame it well
but here is what I need help for. I have an editor that uses wxSTC and I
need to enable Autocomplete for different languages/lexers. For example in
<style> tag I want to enable css only and so in <script ....Javascript>,
<?php et al.

I try to get current style but it seems not to work as PHP AC is done in
HTML.

Whats the correct way of dong that?
TIA,
Stefano
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Philippe Lhoste
2013-10-30 16:33:00 UTC
Permalink
am not sure if the heading is correct, if not then help me frame it well but here is what
I need help for. I have an editor that uses wxSTC and I need to enable Autocomplete for
different languages/lexers. For example in <style> tag I want to enable css only and so in
<script ....Javascript>, <?php et al.
I try to get current style but it seems not to work as PHP AC is done in HTML.
Whats the correct way of dong that?
Currently, Scintilla is not able to switch lexers depending on current lexer's context...

That's why there is a global complex HTML lexer, merging several lexers (JS, CSS, etc.)...
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Stefano Mtangoo
2013-10-30 21:29:57 UTC
Permalink
Post by Stefano Mtangoo
Post by Stefano Mtangoo
am not sure if the heading is correct, if not then help me frame it well
but here is what
Post by Stefano Mtangoo
I need help for. I have an editor that uses wxSTC and I need to enable
Autocomplete for
Post by Stefano Mtangoo
different languages/lexers. For example in <style> tag I want to enable
css only and so in
Post by Stefano Mtangoo
<script ....Javascript>, <?php et al.
I try to get current style but it seems not to work as PHP AC is done in
HTML.
Post by Stefano Mtangoo
Whats the correct way of dong that?
Currently, Scintilla is not able to switch lexers depending on current lexer's context...
That's why there is a global complex HTML lexer, merging several lexers (JS, CSS, etc.)...
I see!
Is there a way at least for me to know what current line is? Whether a PHP
or JS?
That will be enough for my app needs.
Post by Stefano Mtangoo
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Colomban Wendling
2013-10-30 21:57:51 UTC
Permalink
Post by Philippe Lhoste
[...]
Currently, Scintilla is not able to switch lexers depending on
current lexer's context...
That's why there is a global complex HTML lexer, merging several
lexers (JS, CSS, etc.)...
I see!
Is there a way at least for me to know what current line is? Whether a
PHP or JS?
That will be enough for my app needs.
Yes, for this you just have to check the style at the position you want
to check, each embedded language being styled with a different set of
styles.

In Geany we do this:
https://github.com/geany/geany/blob/master/src/editor.c#L2741

Regards,
Colomban
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Stefano Mtangoo
2013-10-30 23:47:04 UTC
Permalink
Post by Colomban Wendling
Post by Philippe Lhoste
[...]
Currently, Scintilla is not able to switch lexers depending on
current lexer's context...
That's why there is a global complex HTML lexer, merging several
lexers (JS, CSS, etc.)...
I see!
Is there a way at least for me to know what current line is? Whether a
PHP or JS?
That will be enough for my app needs.
Yes, for this you just have to check the style at the position you want
to check, each embedded language being styled with a different set of
styles.
https://github.com/geany/geany/blob/master/src/editor.c#L2741
Exactly what I wanted.
Thanks A lot!
Post by Colomban Wendling
Regards,
Colomban
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...