Permalink
Browse files

style tweakage

  • Loading branch information...
1 parent f35b30e commit 1e67a9e9cbe82b8ca3005f21304c2f2525947c55 @defunkt committed Oct 29, 2008
Showing with 3 additions and 8 deletions.
  1. +3 −8 electron.wordwrap.js
View
@@ -1,19 +1,14 @@
Electron.Wordwrap = function() {
var wrapped = false
Neutron.addMenuItem('Format', 'Word Wrap', function() {
- Neutron.toggleMenuItemState('Format', 'Word Wrap')
- if (wrapped) {
- wrapped = false
- currentBuffer.dom().style.wordWrap = 'normal'
- } else {
- wrapped = true
- currentBuffer.dom().style.wordWrap = 'break-word'
- }
+ currentBuffer.dom().style.wordWrap = wrapped ? 'normal' : 'break-word'
+ wrapped = Neutron.toggleMenuItemState('Format', 'Word Wrap')
})
}
Electron.Wordwrap.prototype = {
deactivate: function() {
Neutron.removeMenuItem('Format', 'Word Wrap')
+ currentBuffer.dom().style.wordWrap = 'normal'
}
}

0 comments on commit 1e67a9e

Please sign in to comment.