Skip to content

Commit

Permalink
Merge remote-tracking branch 'vim-perl/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
rkitover committed May 16, 2015
2 parents 21ccd6b + 8d69964 commit 7fe95a5
Show file tree
Hide file tree
Showing 61 changed files with 5,619 additions and 1,530 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
@@ -1,4 +1,9 @@
language: perl
install:
- sudo apt-get install vim
- cpanm --notest Test::Differences Text::VimColor IO::Pty Test::Deep
- cpanm --notest Test::Differences Text::VimColor IO::Pty Test::Deep Parallel::ForkManager JSON Path::Tiny Test::SharedFork
- git fetch origin p5-corpus:origin/p5-corpus
- vim --version
branches:
except:
- p5-corpus
34 changes: 21 additions & 13 deletions CONTRIBUTING.md
Expand Up @@ -6,24 +6,32 @@ When submitting an issue relating to highlighting/folding, please attach the fol
- The file used in the screenshot. If it's proprietary or too big, please try
to reproduce the issue in a small sample file.
- A link to your vimrc, if it exists.
- The output of `vim --version`.

These things make issues **much** easier to debug!

Also, remember that scripts under `contrib` or other third party plugins have the potential to
**IMPORTANT**

Remember that scripts under `contrib` or other third party plugins have the potential to
break your highlighting/folding; if you find an issue, please try it without any contrib scripts or
other plugins set up.
other plugins set up. This includes any `after/syntax/perl` scripts you have set up yourself, of course.
To make things easier on everyone, try to reproduce the issue with a minimal vim setup and an up-to-date
checkout of vim-perl. Taking the time to help out with issues you have found makes things easier on all
of us, and that's the whole reason this is an open project. =)

Also, before you report something as a bug, please make sure you're using the latest version of
vim-perl from Git. If you're using an older version, chances are that you're stumbling on a bug that
someone else has in the past.

If you have read and understand these guidelines, add the text "I have read the guidelines" in your issue
when you create it.

# Helping Out

If you would like to contribute to vim-perl, please be aware that we have a test suite which can
be run using the `prove` command. We also have a regression test suite in the `build-corpus.pl`
and `verify-corpus.pl` scripts. If you plan on making changes to vim-perl, please drop the sources
for `Moose`, `Data::Printer`, and `Regexp::Debugger` under a directory named `corpus` under the
Git root, and extract the archives. Then run `build-corpus.pl`; this will take a few seconds.

After you've made your changes, run the test suite via `prove`, as well as the regression tests
via `verify-corpus.pl`. The former tests a host of known situations for consistency, and the
latter simply verifies that vim-perl still highlights and folds code the way it did when you
ran `build-corpus.pl`. Most fixes don't change highlighting, so `verify-corpus.pl` should print
nothing. If it does, open the file(s) printed and make sure that their highlighting still makes
sense.
be run using the `prove` command. After you've made your changes, run the test suite via `prove`.
The tests test a host of known situations for consistency, as well as verifies that vim-perl still
highlights and folds code the way it does with the latest code on GitHub. Most fixes don't change highlighting,
so the regression test should pass. If it fails, open the file(s) printed and make sure that their highlighting
still makes sense. If it does, note that in your pull request and a maintainer will update the regression corpus
data when he/she merges it.
12 changes: 11 additions & 1 deletion Changes
Expand Up @@ -41,6 +41,14 @@ M. Carlson.
Provide information to matchit plugin to jump between if/elsif/else.
Credit to Alan Young.

Added "fc" and "evalbytes" keywords. Thanks, Rafael Kitover.

Added optional highlighting for subroutine signatures, as well
as highlighting for new postfix dereferencing. Thanks, mattn!

Added tap.vim (based on https://github.com/threebytesfull/perltest). Thanks
to Rufus Cable for sharing!

[FIXES]
Minor tweak to p6RxCharClass. Thanks, Arne Skjærholt.

Expand All @@ -58,10 +66,12 @@ Braces within a heredoc no longer confuse the highlighting.

Keyword detection for "accept" was looking for "acept".

Added higlighting for "import" and "format".
Added highlighting for "import" and "format".

Stop setting "iskeyword" globally. (Hinrik)

Fix folding for subroutines with prototypes. (zdm)

[TESTING]
Added a test harness in t/ (try "make test"). Moved example code
to t_source/ (Hinrik)
Expand Down
54 changes: 49 additions & 5 deletions Makefile
Expand Up @@ -5,14 +5,12 @@ INDENT=$(PREFIX)/indent
SYNTAX=$(PREFIX)/syntax
TOOLS=$(PREFIX)/tools

default:
@echo There is no default target.
@echo Some targets: test, install
default: preproc

dirs:
mkdir -p $(FTPLUGIN) $(INDENT) $(SYNTAX) $(TOOLS)

install: dirs
install: dirs fix_old_vim
cp ftplugin/*.vim $(FTPLUGIN)/
cp indent/*.vim $(INDENT)/
cp syntax/*.vim $(SYNTAX)/
Expand All @@ -21,5 +19,51 @@ install: dirs
tarball:
perl tools/make-tarball.pl

test:
test: preproc fix_old_vim
prove -rv t

test6: preproc
perl t/01_highlighting.t t_source/perl6/*.t

clean:
rm -fr after/syntax/perl

contrib_syntax:
mkdir -p after/syntax/perl

carp: contrib_syntax
cp contrib/carp.vim after/syntax/perl/

dancer: contrib_syntax
cp contrib/dancer.vim after/syntax/perl/

heredoc-sql-mason: contrib_syntax
cp contrib/heredoc-sql-mason.vim after/syntax/perl/

heredoc-sql: contrib_syntax
cp contrib/heredoc-sql.vim after/syntax/perl/

highlight-all-pragmas: contrib_syntax
cp contrib/highlight-all-pragmas.vim after/syntax/perl/

js-css-in-mason: contrib_syntax
cp contrib/js-css-in-mason.vim after/syntax/perl/

method-signatures: contrib_syntax
cp contrib/method-signatures.vim after/syntax/perl/

moose: contrib_syntax
cp contrib/moose.vim after/syntax/perl/

test-more: contrib_syntax
cp contrib/test-more.vim after/syntax/perl/

try-tiny: contrib_syntax
cp contrib/try-tiny.vim after/syntax/perl/

preproc:
tools/preproc.pl syntax/perl6.vim.pre > syntax/perl6.vim

# this gets rid of a regex optimization introduced in Vim 7.4
fix_old_vim:
expr `vim --version|head -n1|grep -Poh '\d\.\d'|head -n1` \< 7.4 >/dev/null && sed -i 's/\\@[0-9]\+/\\@/g; /version < 704/d' syntax/perl6.vim; true
40 changes: 32 additions & 8 deletions README.md
@@ -1,5 +1,7 @@
# vim-perl

[![Build Status](https://api.travis-ci.org/vim-perl/vim-perl.png?branch=master)](https://travis-ci.org/vim-perl/vim-perl)

This is the aggregation of all the various Perl-related syntax and
helper files for Perl 5 and Perl 6.

Expand All @@ -10,12 +12,31 @@ You can install vim-perl using
* [Pathogen](https://github.com/tpope/vim-pathogen) and git submodules
* [Vundle](https://github.com/gmarik/vundle)
* [VAM](https://github.com/MarcWeber/vim-addon-manager)
* [vim-plug](https://github.com/junegunn/vim-plug)

They were all tested and work: please read the related documentation on the related sites.

The legacy method is to install just do a "make install" and you'll get the
.vim files all installed in your `~/.vim` directory.

## Installing using [vim-plug](https://github.com/junegunn/vim-plug)

In your `.vimrc`:

call plug#begin('~/.vim/plugged')

Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' }

call plug#end()

Re-source your configuration, do `PlugInstall`, and you're done.

The `do` argument is optional, and can be used
if you want to enable any of the optional sub-syntaxes.

The `perl` argument is also optional, and only required if you want to
lazy-load the plugin only if dealing with Perl files.

# Getting Help

Any bug reports/feature requests/patches should be directed to the [vim-perl group](https://groups.google.com/group/vim-perl).
Expand All @@ -28,7 +49,17 @@ as a screenshot demonstrating the problem.
## Can you add highlighting for Moose, Try::Tiny, Test::More, SQL in strings, etc?

We have syntax "extensions" under the `contrib/` directory; you can find custom highlighting
for these sorts of things there.
for these sorts of things there. To enable any of them, just drop the relevant
file in a `after/syntax/perl` directory visible to vim.

$ cp contrib/dancer.vim ~/.vim/after/syntax/perl/

You can also populate the local `after/syntax/perl/` via `make`:

$ make dancer moose

$ ls after/syntax/perl
dancer.vim moose.vim

## Curly braces inside of regexes/strings are considered when I use %

Expand All @@ -38,13 +69,6 @@ Vim itself only considers double quotes in this scenario; the matchit plugin, ho
can deal with this scenario and vim-perl's files are set up to work with it should you
choose to use it.

# Contributing

If you would like to contribute to vim-perl (which would be greatly appreciated!), you may find
the `build-corpus.pl` and `verify-corpus.pl` scripts of use. What I do is drop the sources
for `Moose`, `Data::Printer`, and `Regexp::Debugger` in the corpus directory and use the scripts
to make sure my changes don't cause regressions in highlighting and folding.

xoxo,<br />
eiro,<br />
Andy (andy@petdance.com)

0 comments on commit 7fe95a5

Please sign in to comment.