The InnerView class implements responder actions such as cut:, copy:, paste:, undo:, redo: but does not enable/disable user interface items such as a menu item or a toolbar item that have those action methods set. So menu items such as Edit > Undo, Edit > Redo are always enabled when they shouldn't be and Copy is always enabled even when there's no selection. All that's needed is for the following to be added to ScintillaView.mm,
if (action==@selector(undo:)) {
return [self canUndo];
}
else if (action==@selector(redo:)) {
return [self canRedo];
}
else if (action==@selector(cut:) || action==@selector(copy:) || action==@selector(clear:)) {
return mOwner.backend->HasSelection();
}
else if (action==@selector(paste:)) {
return mOwner.backend->CanPaste();
}
return YES;
}
You'll notice that I also handle clear: which is simply,
Committed as [0738f2].
Related
Commit: [0738f2]