diff --git a/ChangeLog b/ChangeLog index 5ea8c33badd9f05ae03c1b75a0eff59c55259afa..1d74a78016444b4a4997a9090e06143e502ca934 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +2008-09-30 Chris Allegretta <chrisa@asty.org> + * python.nanorc, ruby.nanorc: Add header lines for python and ruby as well 2008-09-21 Chris Allegretta <chrisa@asty.org> * 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 fc0907acba0913a1122e2d118c9b6aeda20f67ea..9a20318d3b3c5250d9a2590002a47e7057da4fa2 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 a557287ef1d3388bf0189f13e79cbbc41daff4b7..b30b229d0b505e2c5d3d1e61c885ed094da7afa1 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