Open yepher opened 7 years ago
BUG
When clicking File->Saveor Generate in ParseGenApp the undo history is lost.
File
Save
Generate
ParseGenApp
This makes it hard to quickly test a new grammar entry and then rollback to pre-edit condition.
The app should maintain undo history while it is running in the same document.
NSTextView is bound to grammar as KVO in interface builder
grammar
NSTextView editable is bound to busy as KVO in interface builder
busy
Saving doc caret jumps to top of doc
When saving NSTextView looses focus
Disable busy logic keeps undo history after generate but still broken for File->Save
generate
(void)done { ... // self.busy = NO; // [self focusTextView]; ... }
(IBAction)generate:(id)sender { ... //self.busy = YES; ... }
Looking through the code there are defensive copies of NSString which does not make sense to me since NSString is immutable anyway.
I am not exactly clear why there is KVO for grammar<->NSTextView.
BUG
When clicking
File
->Save
orGenerate
inParseGenApp
the undo history is lost.This makes it hard to quickly test a new grammar entry and then rollback to pre-edit condition.
The app should maintain undo history while it is running in the same document.
Some research notes on issue
NSTextView is bound to
grammar
as KVO in interface builderNSTextView editable is bound to
busy
as KVO in interface builderSaving doc caret jumps to top of doc
When saving NSTextView looses focus
Disable busy logic keeps undo history after
generate
but still broken forFile
->Save
(void)done { ... // self.busy = NO; // [self focusTextView]; ... }
(IBAction)generate:(id)sender { ... //self.busy = YES; ... }