Add "html_asp_default_language" pseudo style to filetypes.xml to allow setting the used language in embedded ASP code (patch by Ross McKay, thanks).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4235 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2009-09-24 17:12:36 +00:00
parent 83f0cdbec0
commit edd50b5f6c
5 changed files with 31 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2009-09-24 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* THANKS, src/about.c, src/highlighting.c, data/filetypes.xml:
Add "html_asp_default_language" pseudo style to filetypes.xml
to allow setting the used language in embedded ASP code
(patch by Ross McKay, thanks).
2009-09-24 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keybindings.c, THANKS:

1
THANKS
View File

@ -69,6 +69,7 @@ Eugene Arshinov <earshinov(at)gmail(dot)com> - Reload color schemes, split lines
Jon Strait <jstrait(at)moonloop(dot)net> - Markdown filetype patch
Forgeot Eric <eforgeot(at)yahoo(dot)fr> - Txt2Tags filetype patch
Lex Trotman <elextr<at>gmail<dot>com> - Build commands configuration improvements, and more
Ross McKay <rosko<at>zeta<dot>org<dot>au> - ASP preferred language option
Translators:
------------

View File

@ -71,6 +71,13 @@ jscript_regex=0x105090;0xffffff;false;false
# for embedded Python script (<script language="python">...</script>), Python styles from
# filetypes.python are used
# default scripting language for ASP
# 0x000001 = JavaScript (or leave blank for default)
# 0x000002 = VBScript
# 0x000003 = Python
#html_asp_default_language=0x000002
[keywords]
html=a abbr acronym address applet area b base basefont bdo big blockquote body br button caption center cite code col colgroup dd del dfn dir div dl dt em embed fieldset font form frame frameset h1 h2 h3 h4 h5 h6 head hr html i iframe img input ins isindex kbd label legend li link map menu meta noframes noscript object ol optgroup option p param pre q quality s samp script select small span strike strong style sub sup table tbody td textarea tfoot th thead title tr tt u ul var xmlns leftmargin topmargin abbr accept-charset accept accesskey action align alink alt archive axis background bgcolor border cellpadding cellspacing char charoff charset checked cite class classid clear codebase codetype color cols colspan compact content coords data datafld dataformatas datapagesize datasrc datetime declare defer dir disabled enctype face for frame frameborder selected headers height href hreflang hspace http-equiv id ismap label lang language link longdesc marginwidth marginheight maxlength media framespacing method multiple name nohref noresize noshade nowrap object onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseover onmouseout onmouseup onreset onselect onsubmit onunload profile prompt pluginspage readonly rel rev rows rowspan rules scheme scope scrolling shape size span src standby start style summary tabindex target text title type usemap valign value valuetype version vlink vspace width text password checkbox radio submit reset file hidden image public doctype xml xml:lang
javascript=abs abstract acos anchor asin atan atan2 big bold boolean break byte case catch ceil char charAt charCodeAt class concat const continue cos Date debugger default delete do double else enum escape eval exp export extends false final finally fixed float floor fontcolor fontsize for fromCharCode function goto if implements import in indexOf Infinity instanceof int interface isFinite isNaN italics join lastIndexOf length link log long Math max MAX_VALUE min MIN_VALUE NaN native NEGATIVE_INFINITY new null Number package parseFloat parseInt pop POSITIVE_INFINITY pow private protected public push random return reverse round shift short sin slice small sort splice split sqrt static strike string String sub substr substring sup super switch synchronized tan this throw throws toLowerCase toString toUpperCase transient true try typeof undefined unescape unshift valueOf var void volatile while with

View File

@ -85,7 +85,7 @@ static const gchar *contributors =
"Elias Pschernig, Eric Forgeot, Eugene Arshinov, Felipe Pena, François Cami, "
"Giuseppe Torelli, Guillaume de Rorthais, Guillaume Hoffmann, Herbert Voss, Jason Oster, Jean-François Wauthy, Jeff Pohlmeyer, "
"Jesse Mayes, John Gabriele, Jon Strait, Josef Whiter, Kevin Ellwood, Kristoffer A. Tjernås, Marko Peric, Matti Mårds, Moritz Barsnick, "
"Peter Strand, Philipp Gildein, Pierre Joye, Rob van der Linde, Robert McGinley, Roland Baudin, S Jagannathan, Saleem Abdulrasool, "
"Peter Strand, Philipp Gildein, Pierre Joye, Rob van der Linde, Robert McGinley, Roland Baudin, Ross McKay, S Jagannathan, Saleem Abdulrasool, "
"Sebastian Kraft, Shiv, Slava Semushin, Stefan Oltmanns, Tamim, Thomas Martitz, Tomás Vírseda, "
"Tyler Mulligan, Walery Studennikov, Yura Siamashka";

View File

@ -1313,7 +1313,7 @@ static void styleset_html(ScintillaObject *sci)
static void styleset_markup_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
{
new_styleset(GEANY_FILETYPES_XML, 56);
new_styleset(GEANY_FILETYPES_XML, 57);
get_keyfile_hex(config, config_home, "html_default", 0x000000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_XML].styling[0]);
get_keyfile_hex(config, config_home, "html_tag", 0x000099, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_XML].styling[1]);
get_keyfile_hex(config, config_home, "html_tagunknown", 0xff0000, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_XML].styling[2]);
@ -1373,6 +1373,8 @@ static void styleset_markup_init(gint ft_id, GKeyFile *config, GKeyFile *config_
get_keyfile_hex(config, config_home, "jscript_symbols", 0x301010, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_XML].styling[53]);
get_keyfile_hex(config, config_home, "jscript_stringeol", 0x000000, 0xe0c0e0, FALSE, &style_sets[GEANY_FILETYPES_XML].styling[54]);
get_keyfile_hex(config, config_home, "jscript_regex", 0x105090, 0xffffff, FALSE, &style_sets[GEANY_FILETYPES_XML].styling[55]);
/* custom hack for asp.default.language setting, uses foreground only */
get_keyfile_hex(config, config_home, "html_asp_default_language", 0x000001, 0x000000, FALSE, &style_sets[GEANY_FILETYPES_XML].styling[56]);
style_sets[GEANY_FILETYPES_XML].keywords = g_new(gchar*, 7);
get_keyfile_keywords(config, config_home, "html", GEANY_FILETYPES_XML, 0, "a abbr acronym address applet area b base basefont bdo big blockquote body br button caption center cite code col colgroup dd del dfn dir div dl dt em embed fieldset font form frame frameset h1 h2 h3 h4 h5 h6 head hr html i iframe img input ins isindex kbd label legend li link map menu meta noframes noscript object ol optgroup option p param pre q quality s samp script select small span strike strong style sub sup table tbody td textarea tfoot th thead title tr tt u ul var xmlns leftmargin topmargin abbr accept-charset accept accesskey action align alink alt archive axis background bgcolor border cellpadding cellspacing char charoff charset checked cite class classid clear codebase codetype color cols colspan compact content coords data datafld dataformatas datapagesize datasrc datetime declare defer dir disabled enctype face for frame frameborder selected headers height href hreflang hspace http-equiv id ismap label lang language link longdesc marginwidth marginheight maxlength media framespacing method multiple name nohref noresize noshade nowrap object onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseover onmouseout onmouseup onreset onselect onsubmit onunload profile prompt pluginspage readonly rel rev rows rowspan rules scheme scope scrolling shape size span src standby start style summary tabindex target text title type usemap valign value valuetype version vlink vspace width text password checkbox radio submit reset file hidden image public doctype xml xml:lang");
@ -1388,6 +1390,7 @@ static void styleset_markup_init(gint ft_id, GKeyFile *config, GKeyFile *config_
static void styleset_markup(ScintillaObject *sci, gboolean set_keywords)
{
guint i;
gint asp_default_language;
const gchar *keywords;
/* Used by several filetypes */
@ -1538,6 +1541,16 @@ static void styleset_markup(ScintillaObject *sci, gboolean set_keywords)
SSM(sci, SCI_SETPROPERTY, (uptr_t) "fold.html", (sptr_t) "1");
SSM(sci, SCI_SETPROPERTY, (uptr_t) "fold.html.preprocessor", (sptr_t) "0");
/* hack to check for asp.default.language setting in filetypes.xml file */
asp_default_language = style_sets[GEANY_FILETYPES_XML].styling[56].foreground;
asp_default_language >>= 16; /* encodeded as BBGGRR, grab just BB */
if (asp_default_language > 1)
{
gchar *asp_default_lang = g_strdup_printf("%d", asp_default_language);
SSM(sci, SCI_SETPROPERTY, (uptr_t) "asp.default.language", (sptr_t) &asp_default_lang[0]);
g_free(asp_default_lang);
}
}