Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • function! GotoCFile()
        :write!
        :redraw!
     
        let cfile_prefix     = '#\s*cfile:\s*'
        let cfile_expression = cfile_prefix . '\w\+'
        if match(getline('.'), cfile_expression) > -1
            let good_line = matchstr(getline('.'), cfile_expression)
            " probably need some more interesting way to make a relative path
            " also need to get rid of any stuff that might

    • Unfortunately matchstr() operates on a string, not the current buffer, so you've first of all had to read the current line into a string.

      This has the distinct disadvantage that it only works if you already happen to be on the line that you're looking for.

      Smylers