Skip to content

Commit f9c884e

Browse files
Kai Woodinfininight
authored andcommitted
Syntax checker now populates the gutter
1 parent 9187908 commit f9c884e

2 files changed

Lines changed: 31 additions & 6 deletions

File tree

Commands/Check ERB Syntax.plist

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@
66
<string>nop</string>
77
<key>command</key>
88
<string>#!/usr/bin/env ruby18
9+
require "shellwords"
910
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
11+
1012
puts "Using " + `"${TM_RUBY:=ruby}" -e'puts "ruby-" + RUBY_VERSION.to_s'`.chomp + " / " + `"${TM_ERB:=erb}" --version 2&gt;&amp;1`.chomp
11-
result = `"${TM_ERB:=erb}" -T - -x | "${TM_RUBY:=ruby}" -c 2&gt;&amp;1`
12-
puts result
13-
TextMate.go_to :line =&gt; $1 if result =~ /-:(\d+):/</string>
13+
puts result = `"${TM_ERB:=erb}" -T - -x | "${TM_RUBY:=ruby}" -c 2&gt;&amp;1`
14+
15+
if result =~ /-:(\d+):(.*)/
16+
TextMate.go_to :line =&gt; $1
17+
`"$TM_MATE" -c warning`
18+
result.each_line do |line|
19+
if line =~ /-:(\d+):(.*)/
20+
`"$TM_MATE" --set-mark warning:#{Shellwords.escape($2)} --line #{$1}`
21+
end
22+
end
23+
else
24+
`"$TM_MATE" -c warning`
25+
end
26+
</string>
1427
<key>input</key>
1528
<string>document</string>
1629
<key>inputFormat</key>

Commands/Check Ruby Syntax.plist

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,23 @@
66
<string>nop</string>
77
<key>command</key>
88
<string>#!/usr/bin/env ruby18
9+
require "shellwords"
910
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
11+
1012
puts `"${TM_RUBY:=ruby}" -e'puts "Using ruby-" + RUBY_VERSION.to_s'`
11-
result = `"${TM_RUBY:=ruby}" -wc 2&gt;&amp;1`
12-
puts result
13-
TextMate.go_to :line =&gt; $1 if result =~ /-:(\d+):/
13+
puts result = `"${TM_RUBY:=ruby}" -wc 2&gt;&amp;1`
14+
15+
if result =~ /-:(\d+):(.*)/
16+
TextMate.go_to :line =&gt; $1
17+
`"$TM_MATE" -c warning`
18+
result.each_line do |line|
19+
if line =~ /-:(\d+):(.*)/
20+
`"$TM_MATE" --set-mark warning:#{Shellwords.escape($2)} --line #{$1}`
21+
end
22+
end
23+
else
24+
`"$TM_MATE" -c warning`
25+
end
1426
</string>
1527
<key>input</key>
1628
<string>document</string>

0 commit comments

Comments
 (0)