Devel::IntelliPerl::Editor::TextMate - IntelliPerl integration for TextMate


Devel-IntelliPerl documentation  | view source Contained in the Devel-IntelliPerl distribution.

Index


NAME

Top

Devel::IntelliPerl::Editor::TextMate - IntelliPerl integration for TextMate

VERSION

Top

version 0.04

SYNOPSIS

Top

    #!/usr/bin/env ruby -wKU
    require ENV["TM_SUPPORT_PATH"] + "/lib/ui.rb"
    require ENV["TM_SUPPORT_PATH"] + "/lib/exit_codes.rb"

    out=`perl -MDevel::IntelliPerl::Editor::TextMate -e 'run' $TM_LINE_NUMBER $TM_LINE_INDEX "$TM_FILEPATH" 2>&1`

    if /^\$error\$/.match(out) then
      out = out.sub("$error$", "")
      TextMate.exit_show_tool_tip out
    end

    choices = out.split("\n")
    ENV['TM_CURRENT_WORD'] ||= ""

    if choices.size == 1 then
      print choices.first.sub(ENV['TM_CURRENT_WORD'], "")
    else 
      choice = TextMate::UI.menu(choices)
      if choice then
        print choices[choice].sub(ENV['TM_CURRENT_WORD'], "")
      end
    end

Create a new Command in the Bundle Editor and paste this bash script. Set "Input" to Entire Document and "Output" to Insert as Text. If you set "Scope Selector" to source.perl this script is run only if you are editing a perl file.

To run this command using a key set "Activation" to "Key Equivalent" and type the desired key in the box next to it.

METHODS

Top

editor

Set to TextMate.

run

This method is exported and invokes Devel::IntelliPerl.

SEE ALSO

Top

http://macromates.com/, Devel::IntelliSense

COPYRIGHT & LICENSE

Top


Devel-IntelliPerl documentation  | view source Contained in the Devel-IntelliPerl distribution.