Home > Apple, English, Mac, OS X, Ruby, TextMate > Keyboard navigation for TextMate stacktraces

Keyboard navigation for TextMate stacktraces

June 29th, 2008

Keyboard navigation for TextMate stacktraces

Put this script at the end of /Applications/TextMate.app/Contents/SharedSupport/Support/script/webpreview.js.

[jscript]
document.addEventListener(’keypress’, function(e){
var key = e.keyCode
if (key != 63233 && key != 63232) return
links = document.getElementsByTagName(’a')
for (var i = 1; i < links.length; i++)
if (links[i].title == ‘focused’) break
if (i == links.length) i = 0
links[i].title = null
if (key == 63233){
if (i == (links.length - 1)) i = 1
else i += 1
}
if (key == 63232){
if (i <= 1) i = links.length - 1
else i -= 1
}
links[i].title = ‘focused’
links[i].focus()
})
[/jscript]

Incredibly useful when I am running my tests!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Reddit
  • StumbleUpon

Apple, English, Mac, OS X, Ruby, TextMate , , ,

  1. No comments yet.
  1. No trackbacks yet.