Auto scroll on log update

This commit is contained in:
Matthias Neeracher 2014-12-01 04:11:53 +01:00 committed by Matthias Neeracher
parent ef13cd0c83
commit 35840c56d0

View File

@ -182,8 +182,10 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate {
var modified : AnyObject? var modified : AnyObject?
if (url!.getResourceValue(&modified, forKey:NSURLAttributeModificationDateKey, error:nil)) { if (url!.getResourceValue(&modified, forKey:NSURLAttributeModificationDateKey, error:nil)) {
if (modified as NSDate).compare(logModified) == .OrderedDescending { if (modified as NSDate).compare(logModified) == .OrderedDescending {
var enc : UInt = 0 var enc : UInt = 0
editor.setString(NSString(contentsOfURL:url!, usedEncoding:&enc, error:nil)) let newText = NSString(contentsOfURL:url!, usedEncoding:&enc, error:nil)
editor.setString(newText)
editor.gotoLine(1000000000, column: 0, animated: true)
logModified = modified as NSDate logModified = modified as NSDate
} }
} }