SF.net SVN: geany:[3004] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Sep 26 12:24:00 UTC 2008


Revision: 3004
          http://geany.svn.sourceforge.net/geany/?rev=3004&view=rev
Author:   ntrel
Date:     2008-09-26 12:23:59 +0000 (Fri, 26 Sep 2008)

Log Message:
-----------
Apply patch from Andrew Rowland to add support for the R language
(thanks, #2121502).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/THANKS
    trunk/data/filetype_extensions.conf
    trunk/scintilla/KeyWords.cxx
    trunk/scintilla/Makefile.am
    trunk/scintilla/makefile.win32
    trunk/src/about.c
    trunk/src/editor.c
    trunk/src/filetypes.c
    trunk/src/filetypes.h
    trunk/src/highlighting.c
    trunk/src/plugindata.h
    trunk/src/templates.c

Added Paths:
-----------
    trunk/data/filetypes.r
    trunk/scintilla/LexR.cxx

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/ChangeLog	2008-09-26 12:23:59 UTC (rev 3004)
@@ -3,6 +3,13 @@
  * src/editor.c:
    Return GEANY_AUTOINDENT_BASIC from editor_get_indent_prefs() if the
    per-document pref is set, even if the global mode is none.
+ * scintilla/makefile.win32, scintilla/LexR.cxx,
+   scintilla/KeyWords.cxx, scintilla/Makefile.am, src/templates.c,
+   src/highlighting.c, src/plugindata.h, src/about.c,
+   src/filetypes.c, src/filetypes.h, src/editor.c, THANKS,
+   data/filetype_extensions.conf, data/filetypes.r:
+   Apply patch from Andrew Rowland to add support for the R language
+   (thanks, #2121502).
 
 
 2008-09-25  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/THANKS
===================================================================
--- trunk/THANKS	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/THANKS	2008-09-26 12:23:59 UTC (rev 3004)
@@ -48,6 +48,7 @@
 Colomban Wendling <colombanw(at)users(dot)sourceforge(dot)net> - GLSL filetype patch
 Timothy Boronczyk <tboronczyk(at)gmail(dot)com> - scroll_stop_at_last_line GUI pref patch
 Jason Oster <parasytic(at)users(dot)sourceforge(dot)net> - various patches
+Andrew Rowland <weibullguy(at)charter(dot)net> - R filetype patch
 
 Translators:
 ------------

Modified: trunk/data/filetype_extensions.conf
===================================================================
--- trunk/data/filetype_extensions.conf	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/data/filetype_extensions.conf	2008-09-26 12:23:59 UTC (rev 3004)
@@ -27,6 +27,7 @@
 Perl=*.pl;*.perl;*.pm;*.agi;*.pod;
 PHP=*.php;*.php3;*.php4;*.php5;*.phtml;
 Python=*.py;*.pyw;
+R=*.R;*.r;
 Ruby=*.rb;*.rhtml;*.ruby;
 Sh=*.sh;configure;configure.in;configure.in.in;configure.ac;*.ksh;*.zsh;*.ash;*.bash;
 Tcl=*.tcl;*.tk;*.wish;

Added: trunk/data/filetypes.r
===================================================================
--- trunk/data/filetypes.r	                        (rev 0)
+++ trunk/data/filetypes.r	2008-09-26 12:23:59 UTC (rev 3004)
@@ -0,0 +1,46 @@
+# For complete documentation of this file, please see Geany's main documentation
+[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
+
+[keywords]
+# all items must be in one line
+#primary=source if else for cbind rbind break array matrix
+#secondary=
+
+[settings]
+# default extension used when saving files
+extension=R
+
+# the following characters are these which a "word" can contains, see documentation
+#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
+
+# if only single comment char is supported like # in this file, leave comment_close blank
+comment_open=#
+comment_close=
+# this is an alternative way, so multiline comments are used
+#comment_open=/*
+#comment_close=*/
+
+# set to false if a comment character/string should start at column 0 of a line, true uses any
+# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
+   #command_example();
+# setting to false would generate this
+#  command_example();
+# This setting works only for single line comments
+comment_use_indent=false
+
+# context action command (please see Geany's main documentation for details)
+context_action_cmd=
+


Property changes on: trunk/data/filetypes.r
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Modified: trunk/scintilla/KeyWords.cxx
===================================================================
--- trunk/scintilla/KeyWords.cxx	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/scintilla/KeyWords.cxx	2008-09-26 12:23:59 UTC (rev 3004)
@@ -169,6 +169,7 @@
 	LINK_LEXER(lmPHPSCRIPT);
 	LINK_LEXER(lmProps);
 	LINK_LEXER(lmPython);
+	LINK_LEXER(lmR);
 	LINK_LEXER(lmRuby);
 	LINK_LEXER(lmSQL);
 	LINK_LEXER(lmTCL);

Added: trunk/scintilla/LexR.cxx
===================================================================
--- trunk/scintilla/LexR.cxx	                        (rev 0)
+++ trunk/scintilla/LexR.cxx	2008-09-26 12:23:59 UTC (rev 3004)
@@ -0,0 +1,213 @@
+// Scintilla source code edit control
+/** @file Lexr.cxx
+ ** Lexer for R, S, SPlus Statistics Program (Heavily derived from CPP Lexer).
+ **
+ **/
+// Copyright 1998-2002 by Neil Hodgson <neilh at scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "Platform.h"
+
+#include "PropSet.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "KeyWords.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+	return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
+}
+
+static inline bool IsAWordStart(const int ch) {
+	return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAnOperator(const int ch) {
+	if (isascii(ch) && isalnum(ch))
+		return false;
+	// '.' left out as it is used to make up numbers
+	if (ch == '-' || ch == '+' || ch == '!' || ch == '~' ||
+	        ch == '?' || ch == ':' || ch == '*' || ch == '/' ||
+	        ch == '^' || ch == '<' || ch == '>' || ch == '=' ||
+	        ch == '&' || ch == '|' || ch == '$' || ch == '(' ||
+	        ch == ')' || ch == '}' || ch == '{' || ch == '[' ||
+		ch == ']')
+		return true;
+	return false;
+}
+
+static void ColouriseRDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+                            Accessor &styler) {
+
+	WordList &keywords   = *keywordlists[0];
+	WordList &keywords2 = *keywordlists[1];
+	WordList &keywords3 = *keywordlists[2];
+
+
+	// Do not leak onto next line
+	if (initStyle == SCE_R_INFIXEOL)
+		initStyle = SCE_R_DEFAULT;
+
+
+	StyleContext sc(startPos, length, initStyle, styler);
+
+	for (; sc.More(); sc.Forward()) {
+
+		if (sc.atLineStart && (sc.state == SCE_R_STRING)) {
+			// Prevent SCE_R_STRINGEOL from leaking back to previous line
+			sc.SetState(SCE_R_STRING);
+		}
+
+		// Determine if the current state should terminate.
+		if (sc.state == SCE_R_OPERATOR) {
+			sc.SetState(SCE_R_DEFAULT);
+		} else if (sc.state == SCE_R_NUMBER) {
+			if (!IsADigit(sc.ch) && !(sc.ch == '.' && IsADigit(sc.chNext))) {
+				sc.SetState(SCE_R_DEFAULT);
+			}
+		} else if (sc.state == SCE_R_IDENTIFIER) {
+			if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
+				char s[100];
+				sc.GetCurrentLowered(s, sizeof(s));
+				if (keywords.InList(s)) {
+					sc.ChangeState(SCE_R_KWORD);
+				} else if  (keywords2.InList(s)) {
+					sc.ChangeState(SCE_R_BASEKWORD);
+				} else if  (keywords3.InList(s)) {
+					sc.ChangeState(SCE_R_OTHERKWORD);
+				}
+				sc.SetState(SCE_R_DEFAULT);
+			}
+		} else if (sc.state == SCE_R_COMMENT) {
+			if (sc.ch == '\r' || sc.ch == '\n') {
+				sc.SetState(SCE_R_DEFAULT);
+			}
+		} else if (sc.state == SCE_R_STRING) {
+			if (sc.ch == '\\') {
+				if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+					sc.Forward();
+				}
+			} else if (sc.ch == '\"') {
+				sc.ForwardSetState(SCE_R_DEFAULT);
+			}
+		} else if (sc.state == SCE_R_INFIX) {
+			if (sc.ch == '%') {
+				sc.ForwardSetState(SCE_R_DEFAULT);
+			} else if (sc.atLineEnd) {
+				sc.ChangeState(SCE_R_INFIXEOL);
+				sc.ForwardSetState(SCE_R_DEFAULT);
+			}
+		}else if (sc.state == SCE_R_STRING2) {
+			if (sc.ch == '\\') {
+				if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+					sc.Forward();
+				}
+			} else if (sc.ch == '\'') {
+				sc.ForwardSetState(SCE_R_DEFAULT);
+			}
+		}
+
+		// Determine if a new state should be entered.
+		if (sc.state == SCE_R_DEFAULT) {
+			if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+				sc.SetState(SCE_R_NUMBER);
+			} else if (IsAWordStart(sc.ch) ) {
+				sc.SetState(SCE_R_IDENTIFIER);
+			} else if (sc.Match('#')) {
+					sc.SetState(SCE_R_COMMENT);
+			} else if (sc.ch == '\"') {
+				sc.SetState(SCE_R_STRING);
+			} else if (sc.ch == '%') {
+				sc.SetState(SCE_R_INFIX);
+			} else if (sc.ch == '\'') {
+				sc.SetState(SCE_R_STRING2);
+			} else if (IsAnOperator(sc.ch)) {
+				sc.SetState(SCE_R_OPERATOR);
+			}
+		}
+	}
+	sc.Complete();
+}
+
+// Store both the current line's fold level and the next lines in the
+// level store to make it easy to pick up with each increment
+// and to make it possible to fiddle the current level for "} else {".
+static void FoldRDoc(unsigned int startPos, int length, int, WordList *[],
+                       Accessor &styler) {
+	bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+	bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
+	unsigned int endPos = startPos + length;
+	int visibleChars = 0;
+	int lineCurrent = styler.GetLine(startPos);
+	int levelCurrent = SC_FOLDLEVELBASE;
+	if (lineCurrent > 0)
+		levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
+	int levelMinCurrent = levelCurrent;
+	int levelNext = levelCurrent;
+	char chNext = styler[startPos];
+	int styleNext = styler.StyleAt(startPos);
+	for (unsigned int i = startPos; i < endPos; i++) {
+		char ch = chNext;
+		chNext = styler.SafeGetCharAt(i + 1);
+		int style = styleNext;
+		styleNext = styler.StyleAt(i + 1);
+		bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+		if (style == SCE_R_OPERATOR) {
+			if (ch == '{') {
+				// Measure the minimum before a '{' to allow
+				// folding on "} else {"
+				if (levelMinCurrent > levelNext) {
+					levelMinCurrent = levelNext;
+				}
+				levelNext++;
+			} else if (ch == '}') {
+				levelNext--;
+			}
+		}
+		if (atEOL) {
+			int levelUse = levelCurrent;
+			if (foldAtElse) {
+				levelUse = levelMinCurrent;
+			}
+			int lev = levelUse | levelNext << 16;
+			if (visibleChars == 0 && foldCompact)
+				lev |= SC_FOLDLEVELWHITEFLAG;
+			if (levelUse < levelNext)
+				lev |= SC_FOLDLEVELHEADERFLAG;
+			if (lev != styler.LevelAt(lineCurrent)) {
+				styler.SetLevel(lineCurrent, lev);
+			}
+			lineCurrent++;
+			levelCurrent = levelNext;
+			levelMinCurrent = levelCurrent;
+			visibleChars = 0;
+		}
+		if (!isspacechar(ch))
+			visibleChars++;
+	}
+}
+
+
+static const char * const RWordLists[] = {
+            "Language Keywords",
+            "Base / Default package function",
+            "Other Package Functions",
+            "Unused",
+            "Unused",
+            0,
+        };
+
+
+
+LexerModule lmR(SCLEX_R, ColouriseRDoc, "r", FoldRDoc, RWordLists);


Property changes on: trunk/scintilla/LexR.cxx
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Modified: trunk/scintilla/Makefile.am
===================================================================
--- trunk/scintilla/Makefile.am	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/scintilla/Makefile.am	2008-09-26 12:23:59 UTC (rev 3004)
@@ -9,24 +9,25 @@
 LexAsm.cxx \
 LexBasic.cxx \
 LexBash.cxx \
-LexOMS.cxx \
 LexCPP.cxx \
 LexCaml.cxx \
 LexCrontab.cxx \
 LexCSS.cxx \
 LexD.cxx \
 LexFortran.cxx \
+LexHaskell.cxx \
 LexHTML.cxx \
 LexLua.cxx \
+LexOMS.cxx \
 LexOthers.cxx \
 LexPascal.cxx \
 LexPerl.cxx \
 LexPython.cxx \
+LexR.cxx \
 LexRuby.cxx \
 LexSQL.cxx \
 LexTCL.cxx \
-LexVHDL.cxx \
-LexHaskell.cxx
+LexVHDL.cxx
 
 SRCS= \
 CallTip.cxx \

Modified: trunk/scintilla/makefile.win32
===================================================================
--- trunk/scintilla/makefile.win32	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/scintilla/makefile.win32	2008-09-26 12:23:59 UTC (rev 3004)
@@ -62,7 +62,7 @@
 LEXOBJS=\
 LexBash.o LexAsm.o LexCSS.o LexCPP.o LexCrontab.o LexHTML.o LexOthers.o LexPascal.o \
 LexPerl.o LexPython.o LexSQL.o LexCaml.o LexOMS.o LexTCL.o LexRuby.o LexFortran.o LexVHDL.o \
-LexD.o LexLua.o LexHaskell.o LexBasic.o
+LexD.o LexLua.o LexHaskell.o LexBasic.o LexR.o
 #--Autogenerated -- end of automatically generated section
 
 all: $(COMPLIB)

Modified: trunk/src/about.c
===================================================================
--- trunk/src/about.c	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/src/about.c	2008-09-26 12:23:59 UTC (rev 3004)
@@ -77,7 +77,7 @@
 static const gint prev_translators_len = G_N_ELEMENTS(prev_translators);
 
 static const gchar *contributors =
-"Alexander Rodin, Anh Phạm, blackdog, Bo Lorentsen, Bob Doan, Catalin Marinas, "
+"Alexander Rodin, Andrew Rowland, Anh Phạm, blackdog, Bo Lorentsen, Bob Doan, Catalin Marinas, "
 "Christoph Berg, Daniel Richard G., Dave Moore, Dirk Weber, Felipe Pena, François Cami, "
 "Giuseppe Torelli, Guillaume Hoffmann, Jason Oster, Jean-François Wauthy, Jeff Pohlmeyer, "
 "John Gabriele, Josef Whiter, Kevin Ellwood, Kristoffer A. Tjernås, Marko Peric, Matti Mårds, "

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/src/editor.c	2008-09-26 12:23:59 UTC (rev 3004)
@@ -2700,6 +2700,9 @@
 				style == SCE_PL_POD ||
 				style == SCE_PL_POD_VERB);
 
+		case SCLEX_R:
+			return (style == SCE_R_STRING);
+
 		case SCLEX_RUBY:
 			return (style == SCE_RB_CHARACTER ||
 				style == SCE_RB_STRING ||
@@ -2796,6 +2799,9 @@
 		case SCLEX_BASH:
 			return (style == SCE_SH_COMMENTLINE);
 
+		case SCLEX_R:
+			return (style == SCE_R_COMMENT);
+
 		case SCLEX_SQL:
 			return (style == SCE_SQL_COMMENT ||
 				style == SCE_SQL_COMMENTLINE ||

Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/src/filetypes.c	2008-09-26 12:23:59 UTC (rev 3004)
@@ -461,6 +461,17 @@
 	ft->comment_close = NULL;
 	ft->group = GEANY_FILETYPE_GROUP_COMPILED;
 
+#define R
+	ft = filetypes[GEANY_FILETYPES_R];
+	ft->lang = 34;
+	ft->name = g_strdup("R");
+	ft->title = g_strdup_printf(_("%s script file"), "R");
+	ft->extension = g_strdup("R");
+	ft->pattern = utils_strv_new("*.R", "*.r", NULL);
+	ft->comment_open = g_strdup("#");
+	ft->comment_close = NULL;
+	ft->group = GEANY_FILETYPE_GROUP_SCRIPT;
+
 #define REST
 	ft = filetypes[GEANY_FILETYPES_REST];
 	ft->lang = 28;

Modified: trunk/src/filetypes.h
===================================================================
--- trunk/src/filetypes.h	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/src/filetypes.h	2008-09-26 12:23:59 UTC (rev 3004)
@@ -61,6 +61,7 @@
 	GEANY_FILETYPES_PERL,
 	GEANY_FILETYPES_PHP,
 	GEANY_FILETYPES_PYTHON,
+	GEANY_FILETYPES_R,
 	GEANY_FILETYPES_RUBY,
 	GEANY_FILETYPES_SH,
 	GEANY_FILETYPES_TCL,

Modified: trunk/src/highlighting.c
===================================================================
--- trunk/src/highlighting.c	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/src/highlighting.c	2008-09-26 12:23:59 UTC (rev 3004)
@@ -1558,6 +1558,58 @@
 }
 
 
+static void styleset_r_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
+{
+	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]);
+
+	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;
+
+	get_keyfile_wordchars(config, config_home,
+		&style_sets[GEANY_FILETYPES_R].wordchars);
+}
+
+
+static void styleset_r(ScintillaObject *sci)
+{
+	const filetype_id ft_id = GEANY_FILETYPES_R;
+
+	styleset_common(sci, 5, ft_id);
+
+	apply_filetype_properties(sci, SCLEX_R, ft_id);
+
+	SSM(sci, SCI_SETKEYWORDS, 0, (sptr_t) style_sets[GEANY_FILETYPES_R].keywords[0]);
+
+	set_sci_style(sci, STYLE_DEFAULT, GEANY_FILETYPES_R, 0);
+	set_sci_style(sci, SCE_R_DEFAULT, GEANY_FILETYPES_R, 0);
+	set_sci_style(sci, SCE_R_COMMENT, GEANY_FILETYPES_R, 1);
+	set_sci_style(sci, SCE_R_KWORD, GEANY_FILETYPES_R, 2);
+	set_sci_style(sci, SCE_R_OPERATOR, GEANY_FILETYPES_R, 3);
+	set_sci_style(sci, SCE_R_BASEKWORD, GEANY_FILETYPES_R, 4);
+	set_sci_style(sci, SCE_R_OTHERKWORD, GEANY_FILETYPES_R, 5);
+	set_sci_style(sci, SCE_R_NUMBER, GEANY_FILETYPES_R, 6);
+	set_sci_style(sci, SCE_R_STRING, GEANY_FILETYPES_R, 7);
+	set_sci_style(sci, SCE_R_STRING2, GEANY_FILETYPES_R, 8);
+	set_sci_style(sci, SCE_R_IDENTIFIER, GEANY_FILETYPES_R, 9);
+	set_sci_style(sci, SCE_R_INFIX, GEANY_FILETYPES_R, 10);
+	set_sci_style(sci, SCE_R_INFIXEOL, GEANY_FILETYPES_R, 11);
+}
+
+
 static void styleset_ruby_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
 {
 	new_style_array(GEANY_FILETYPES_RUBY, 35);
@@ -3051,6 +3103,7 @@
 		init_styleset_case(GEANY_FILETYPES_PERL,	perl);
 		init_styleset_case(GEANY_FILETYPES_PHP,		php);
 		init_styleset_case(GEANY_FILETYPES_PYTHON,	python);
+		init_styleset_case(GEANY_FILETYPES_R,		r);
 		init_styleset_case(GEANY_FILETYPES_RUBY,	ruby);
 		init_styleset_case(GEANY_FILETYPES_SH,		sh);
 		init_styleset_case(GEANY_FILETYPES_SQL,		sql);
@@ -3105,6 +3158,7 @@
 		styleset_case(GEANY_FILETYPES_PERL,		perl);
 		styleset_case(GEANY_FILETYPES_PHP,		php);
 		styleset_case(GEANY_FILETYPES_PYTHON,	python);
+		styleset_case(GEANY_FILETYPES_R,		r);
 		styleset_case(GEANY_FILETYPES_RUBY,		ruby);
 		styleset_case(GEANY_FILETYPES_SH,		sh);
 		styleset_case(GEANY_FILETYPES_SQL,		sql);

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/src/plugindata.h	2008-09-26 12:23:59 UTC (rev 3004)
@@ -41,13 +41,13 @@
 enum {
 	/** The Application Programming Interface (API) version, incremented
 	 * whenever any plugin data types are modified or appended to. */
-	GEANY_API_VERSION = 95,
+	GEANY_API_VERSION = 96,
 
 	/** The Application Binary Interface (ABI) version, incremented whenever
 	 * existing fields in the plugin data types have to be changed or reordered. */
 	/* This should usually stay the same if fields are only appended, assuming only pointers to
 	 * structs and not structs themselves are declared by plugins. */
-	GEANY_ABI_VERSION = 45
+	GEANY_ABI_VERSION = 46
 };
 
 /** Check the plugin can be loaded by Geany.
@@ -412,6 +412,8 @@
 {
 	GeanyFiletype*	(*detect_from_file) (const gchar *utf8_filename);
 	GeanyFiletype*	(*lookup_by_name) (const gchar *name);
+	/* Remember to convert any filetype_id arguments to GeanyFiletype pointers in any
+	 * appended functions */
 }
 FiletypeFuncs;
 

Modified: trunk/src/templates.c
===================================================================
--- trunk/src/templates.c	2008-09-26 12:12:23 UTC (rev 3003)
+++ trunk/src/templates.c	2008-09-26 12:23:59 UTC (rev 3004)
@@ -510,8 +510,8 @@
 	gchar **lines;
 	guint i;
 
-	/** TODO the following switch could be replaced by some intelligent code which reads
-	 ** frame_start, frame_end and line_prefix from the filetype definition files */
+	/* TODO the following switch could be replaced by some intelligent code which reads
+	 * frame_start, frame_end and line_prefix from the filetype definition files */
 	switch (filetype_idx)
 	{
 		case GEANY_FILETYPES_HTML:
@@ -525,6 +525,7 @@
 		}
 
 		case GEANY_FILETYPES_PYTHON:
+		case GEANY_FILETYPES_R:
 		case GEANY_FILETYPES_RUBY:
 		case GEANY_FILETYPES_SH:
 		case GEANY_FILETYPES_MAKE:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list