Merge branch 'master' into global-find

Conflicts:
	src/app/buffer.coffee
This commit is contained in:
Nathan Sobo
2012-07-20 19:01:38 -06:00
9 changed files with 87 additions and 20 deletions

View File

@@ -14,6 +14,7 @@ class Buffer
@idCounter = 1
undoManager: null
modified: null
modifiedOnDisk: null
lines: null
file: null
anchors: null
@@ -52,11 +53,18 @@ class Buffer
this
subscribeToFile: ->
@file?.on "contents-change", =>
unless @isModified()
@file.on "contents-change", =>
if @isModified()
@modifiedOnDisk = true
else
@setText(fs.read(@file.getPath()))
@modified = false
reload: ->
@setText(fs.read(@file.getPath()))
@modified = false
@modifiedOnDisk = false
getPath: ->
@file?.getPath()
@@ -198,9 +206,13 @@ class Buffer
fs.write path, @getText()
@file?.updateMd5()
@modified = false
@modifiedOnDisk = false
@setPath(path)
@trigger 'after-save'
isModifiedOnDisk: ->
@modifiedOnDisk
isModified: ->
@modified

View File

@@ -9,6 +9,7 @@ window.keymap.bindKeys '.editor',
'meta-enter': 'newline-below'
'tab': 'indent'
'backspace': 'backspace'
'shift-backspace': 'backspace'
'delete': 'delete'
'meta-x': 'cut'
'meta-c': 'copy'