From 8227d419bb99893223c5518d7fde8e8e9e1c9cd8 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Tue, 30 Sep 2008 14:30:33 +0000 Subject: [PATCH] 2008-09-30 Chris Allegretta * python.nanorc, ruby.nanorc: Add header lines for python and ruby as well git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4329 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ doc/syntax/python.nanorc | 1 + doc/syntax/ruby.nanorc | 1 + 3 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5ea8c33b..1d74a780 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +2008-09-30 Chris Allegretta + * python.nanorc, ruby.nanorc: Add header lines for python and ruby as well 2008-09-21 Chris Allegretta * rcfile.c, color.c, nano.h: Add new capability for matching a syntax type by the "header" (1st line) of a file being edited. Based on Savannah bug 24197 and inital proof of concept by Dave Geering diff --git a/doc/syntax/python.nanorc b/doc/syntax/python.nanorc index fc0907ac..9a20318d 100644 --- a/doc/syntax/python.nanorc +++ b/doc/syntax/python.nanorc @@ -1,6 +1,7 @@ ## Here is an example for Python. ## syntax "python" "\.py$" +header "^#!.*/python[-0-9._]*" icolor brightblue "def [0-9A-Z_]+" color brightcyan "\<(and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|map|not|or|pass|print|raise|return|try|while)\>" color brightgreen "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}" diff --git a/doc/syntax/ruby.nanorc b/doc/syntax/ruby.nanorc index a557287e..b30b229d 100644 --- a/doc/syntax/ruby.nanorc +++ b/doc/syntax/ruby.nanorc @@ -1,6 +1,7 @@ ## Here is an example for Ruby. ## syntax "ruby" "\.rb$" +header "^#!.*/ruby[-0-9._]*" ## Asciibetical list of reserved words color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>" ## Constants -- 2.39.5