I have NSTextViewwhere I would like to use spaces instead of tabs. Although I would be replaceOccurrencesOfString:withString:options:range:in textStorageWillProcessEditing:mine textview delegate, but it does not work (undoing breaks).
Please, does anyone know how to implement such functionality? Is there any other way to do this?
Edit: this is what I have in the method textStorageWillProcessEditing::
ts = [notification object];
[[ts mutableString] replaceOccurrencesOfString:@"\t"
withString:@" "
options:NSLiteralSearch
range:[ts editedRange]];
source
share