Revision: 3023 http://geany.svn.sourceforge.net/geany/?rev=3023&view=rev Author: eht16 Date: 2008-09-29 18:10:42 +0000 (Mon, 29 Sep 2008)
Log Message: ----------- Fix syntax highlighting for filetype R, synchronise the colours with those other filetypes. Add two more keyword types and add many many more keywords.
Modified Paths: -------------- trunk/ChangeLog trunk/data/filetypes.r trunk/src/highlighting.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-29 18:09:43 UTC (rev 3022) +++ trunk/ChangeLog 2008-09-29 18:10:42 UTC (rev 3023) @@ -1,3 +1,11 @@ +2008-09-29 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * data/filetypes.r, src/highlighting.c: + Fix syntax highlighting for filetype R, synchronise the colours with + those other filetypes. + Add two more keyword types and add many many more keywords. + + 2008-09-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* doc/geany.txt, doc/geany.html:
Modified: trunk/data/filetypes.r =================================================================== --- trunk/data/filetypes.r 2008-09-29 18:09:43 UTC (rev 3022) +++ trunk/data/filetypes.r 2008-09-29 18:10:42 UTC (rev 3023) @@ -2,26 +2,32 @@ [styling] # foreground;background;bold;italic default=0x000000;0xffffff;false;false -#comment=0x000fff;0xffffff;true;false -#kword=0x66ff33;0xffffff;true;false -#operator=0x660000;0xffffff;false;false -#basekword=0x66ff33;0xffffff;false;false -#otherkword=0x66ff33;0xffffff;false;false -#number=0xcc00ff;0xffffff;false;false -#string=0xcc00ff;0xffffff;false;false -#string2=0xcc00ff;0xffffff;false;false -#identifier=0x6600ff;0xffffff;false;false -#infix=0xcc00ff;0xffffff;false;false -#infixeol=0xcc00ff;0xffffff;false;false +comment=0x808080;0xffffff;false;false +# primary keyword +kword=0x00007f;0xffffff;false;false +operator=0x301010;0xffffff;false;false +# package keyword +basekword=0x991111;0xffffff;false;false +# package_other keyword +otherkword=0x991111;0xffffff;false;false +number=0x007f00;0xffffff;false;false +# "blah" string +string=0xff901e;0xffffff;false;false +# 'blah' string +string2=0x008000;0xffffff;false;false +identifier=0x000000;0xffffff;false;false +infix=0x008000;0xffffff;false;false +infixeol=0x000000;0xe0c0e0;false;false
[keywords] # all items must be in one line -#primary=source if else for cbind rbind break array matrix -#secondary= +primary=abs array break data.frame diag else FALSE for function if in Inf matrix NA NaN NCOL next NROW NULL print read.table repeat require return solve source sqrt sum TRUE while +package=abbreviate abline abs acf acos acosh addmargins aggregate agrep alarm alias alist all anova any aov aperm append apply approx approxfun apropos ar args arima array arrows asin asinh assign assocplot atan atanh attach attr attributes autoload autoloader ave axis backsolve barplot basename beta bindtextdomain binomial biplot bitmap bmp body box boxplot bquote break browser builtins bxp by bzfile c call cancor capabilities casefold cat category cbind ccf ceiling character charmatch chartr chol choose chull citation class close cm cmdscale codes coef coefficients col colnames colors colorspaces colours comment complex confint conflicts contour contrasts contributors convolve cophenetic coplot cor cos cosh cov covratio cpgram crossprod cummax cummin cumprod cumsum curve cut cutree cycle data dataentry date dbeta dbinom dcauchy dchisq de debug debugger decompose delay deltat demo dendrapply density deparse deriv det detach determinant deviance dexp df dfbeta dfbetas dffits dgamma dgeom dget dhyper diag diff diffinv difftime digamma dim dimnames dir dirname dist dlnorm dlogis dmultinom dnbinom dnorm dotchart double dpois dput drop dsignrank dt dump dunif duplicated dweibull dwilcox eapply ecdf edit effects eigen emacs embed end environment eval evalq example exists exp expression factanal factor factorial family fft fifo file filter find fitted fivenum fix floor flush for force formals format formula forwardsolve fourfoldplot frame frequency ftable function gamma gaussian gc gcinfo gctorture get getenv geterrmessage gettext gettextf getwd gl glm globalenv gray grep grey grid gsub gzcon gzfile hat hatvalues hcl hclust head heatmap help hist history hsv httpclient iconv iconvlist identical identify if ifelse image influence inherits integer integrate interaction interactive intersect invisible isoreg jitter jpeg julian kappa kernapply kernel kmeans knots kronecker ksmooth labels lag lapply layout lbeta lchoose lcm legend length letters levels lfactorial lgamma library licence license line lines list lm load loadhistory loadings local locator loess log logb logical loglin lowess ls lsfit machine mad mahalanobis makepredictcall manova mapply match matlines matplot matpoints matrix max mean median medpolish menu merge message methods mget min missing mode monthplot months mosaicplot mtext mvfft names napredict naprint naresid nargs nchar ncol next nextn ngettext nlevels nlm nls noquote nrow numeric objects offset open optim optimise optimize options order ordered outer pacf page pairlist pairs palette par parse paste pbeta pbinom pbirthday pcauchy pchisq pdf pentagamma person persp pexp pf pgamma pgeom phyper pi pico pictex pie piechart pipe plclust plnorm plogis plot pmatch pmax pmin pnbinom png pnorm points poisson poly polygon polym polyroot postscript power ppoints ppois ppr prcomp predict preplot pretty princomp print prmatrix prod profile profiler proj promax prompt provide psigamma psignrank pt ptukey punif pweibull pwilcox q qbeta qbinom qbirthday qcauchy qchisq qexp qf qgamma qgeom qhyper qlnorm qlogis qnbinom qnorm qpois qqline qqnorm qqplot qr qsignrank qt qtukey quantile quarters quasi quasibinomial quasipoisson quit qunif quote qweibull qwilcox rainbow range rank raw rbeta rbind rbinom rcauchy rchisq readline real recover rect reformulate regexpr relevel remove reorder rep repeat replace replicate replications require reshape resid residuals restart return rev rexp rf rgamma rgb rgeom rhyper rle rlnorm rlogis rm rmultinom rnbinom rnorm round row rownames rowsum rpois rsignrank rstandard rstudent rt rug runif runmed rweibull rwilcox sample sapply save savehistory scale scan screen screeplot sd search searchpaths seek segments seq sequence serialize setdiff setequal setwd shell sign signif sin single sinh sink smooth solve sort source spectrum spline splinefun split sprintf sqrt stack stars start stderr stdin stdout stem step stepfun stl stop stopifnot str strftime strheight stripchart strptime strsplit strtrim structure strwidth strwrap sub subset substitute substr substring sum summary sunflowerplot supsmu svd sweep switch symbols symnum system t table tabulate tail tan tanh tapply tempdir tempfile termplot terms tetragamma text time title toeplitz tolower topenv toupper trace traceback transform trigamma trunc truncate try ts tsdiag tsp typeof unclass undebug union unique uniroot unix unlink unlist unname unserialize unsplit unstack untrace unz update upgrade url var varimax vcov vector version vi vignette warning warnings weekdays weights which while window windows with write wsbrowser xedit xemacs xfig xinch xor xtabs xyinch yinch zapsmall +package_other=acme aids aircondit amis aml banking barchart barley beaver bigcity boot brambles breslow bs bwplot calcium cane capability cav censboot channing city claridge cloth cloud coal condense contourplot control corr darwin densityplot dogs dotplot ducks empinf envelope environmental ethanol fir frets gpar grav gravity grob hirose histogram islay knn larrows levelplot llines logit lpoints lsegments lset ltext lvqinit lvqtest manaus melanoma melanoma motor multiedit neuro nitrofen nodal ns nuclear oneway parallel paulsen poisons polar qq qqmath remission rfs saddle salinity shingle simplex singer somgrid splom stripplot survival tau tmd tsboot tuna unit urine viewport wireframe wool xyplot
[settings] # default extension used when saving files -extension=R +#extension=R
# the following characters are these which a "word" can contains, see documentation #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
Modified: trunk/src/highlighting.c =================================================================== --- trunk/src/highlighting.c 2008-09-29 18:09:43 UTC (rev 3022) +++ trunk/src/highlighting.c 2008-09-29 18:10:42 UTC (rev 3023) @@ -1549,21 +1549,23 @@ new_style_array(GEANY_FILETYPES_R, 12);
get_keyfile_hex(config, config_home, "styling", "default", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[0]); - get_keyfile_hex(config, config_home, "styling", "comment", "0x0066ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[1]); - get_keyfile_hex(config, config_home, "styling", "kword", "0x66ff33", "0xffffff", "true", &style_sets[GEANY_FILETYPES_R].styling[2]); - get_keyfile_hex(config, config_home, "styling", "operator", "0x660000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[3]); - get_keyfile_hex(config, config_home, "styling", "basekword", "0x66ff33", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[4]); - get_keyfile_hex(config, config_home, "styling", "otherkword", "0x66ff33", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[5]); - get_keyfile_hex(config, config_home, "styling", "number", "0xcc00ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[6]); - get_keyfile_hex(config, config_home, "styling", "string", "0xcc00ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[7]); - get_keyfile_hex(config, config_home, "styling", "string2", "0xcc00ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[8]); - get_keyfile_hex(config, config_home, "styling", "identifier", "0x6600ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[9]); - get_keyfile_hex(config, config_home, "styling", "infix", "0xcc00ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[10]); - get_keyfile_hex(config, config_home, "styling", "infixeol", "0xcc00ff", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[11]); + get_keyfile_hex(config, config_home, "styling", "comment", "0x808080", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[1]); + get_keyfile_hex(config, config_home, "styling", "kword", "0x00007f", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[2]); + get_keyfile_hex(config, config_home, "styling", "operator", "0x301010", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[3]); + get_keyfile_hex(config, config_home, "styling", "basekword", "0x991111", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[4]); + get_keyfile_hex(config, config_home, "styling", "otherkword", "0x991111", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[5]); + get_keyfile_hex(config, config_home, "styling", "number", "0x007f00", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[6]); + get_keyfile_hex(config, config_home, "styling", "string", "0xff901e", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[7]); + get_keyfile_hex(config, config_home, "styling", "string2", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[8]); + get_keyfile_hex(config, config_home, "styling", "identifier", "0x000000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[9]); + get_keyfile_hex(config, config_home, "styling", "infix", "0x008000", "0xffffff", "false", &style_sets[GEANY_FILETYPES_R].styling[10]); + get_keyfile_hex(config, config_home, "styling", "infixeol", "0x000000", "0xe0c0e0", "false", &style_sets[GEANY_FILETYPES_R].styling[11]);
- style_sets[GEANY_FILETYPES_R].keywords = g_new(gchar*, 2); - get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_R, 0, "require if source array matrix diag solve for data.frame read.table NROW NCOL abs sqrt sum print while function"); - style_sets[GEANY_FILETYPES_R].keywords[1] = NULL; + style_sets[GEANY_FILETYPES_R].keywords = g_new(gchar*, 4); + get_keyfile_keywords(config, config_home, "keywords", "primary", GEANY_FILETYPES_R, 0, "abs array data.frame diag for function if matrix NCOL NROW print read.table require return solve source sqrt sum while"); + get_keyfile_keywords(config, config_home, "keywords", "package", GEANY_FILETYPES_R, 1, NULL); + get_keyfile_keywords(config, config_home, "keywords", "package_other", GEANY_FILETYPES_R, 2, NULL); + style_sets[GEANY_FILETYPES_R].keywords[3] = NULL;
get_keyfile_wordchars(config, config_home, &style_sets[GEANY_FILETYPES_R].wordchars); @@ -1577,6 +1579,8 @@ apply_filetype_properties(sci, SCLEX_R, ft_id);
SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_R].keywords[0]); + SSM(sci, SCI_SETKEYWORDS, 1, (sptr_t) style_sets[GEANY_FILETYPES_R].keywords[1]); + SSM(sci, SCI_SETKEYWORDS, 2, (sptr_t) style_sets[GEANY_FILETYPES_R].keywords[2]);
set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_R, 0); set_sci_style(sci, SCE_R_DEFAULT, GEANY_FILETYPES_R, 0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.