Skip to content

Commit

Permalink
Show build completion progress in status bar
Browse files Browse the repository at this point in the history
This is done via the TextMate JavaScript object which has a ‘progress’ property that can be used to control the progress indicator in the status bar. In TextMate see ‘Help → JavaScript Object’ for more information about this object.
  • Loading branch information
sorbits committed Jan 13, 2013
1 parent 24c09d8 commit fbb6997
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Commands/Build.tmCommand
Expand Up @@ -21,7 +21,12 @@ flags << "-f" + File.basename(ENV["TM_NINJA_FILE"])
flags << ENV["TM_NINJA_FLAGS"] unless ENV["TM_NINJA_FLAGS"].nil?
flags << ENV["TM_NINJA_TARGET"] unless ENV["TM_NINJA_TARGET"].nil?
TextMate::Executor.run(e_sh(ENV['TM_NINJA'] || 'ninja'), flags, :verb => "Making", :noun => (ENV["TM_NINJA_TARGET"] || "default"), :use_hashbang => false, :version_args => '--version')
TextMate::Executor.run(e_sh(ENV['TM_NINJA'] || 'ninja'), flags, :verb => "Making", :noun => (ENV["TM_NINJA_TARGET"] || "default"), :use_hashbang => false, :version_args => '--version') do |str, type|
if str =~ /^\[(\d+)\/(\d+)\]\s*/
js = "<script>TextMate.progress = %f</script>" % ($1.to_f / $2.to_f)
js + htmlize(str)
end
end
</string>
<key>input</key>
<string>none</string>
Expand Down

0 comments on commit fbb6997

Please sign in to comment.