mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-10-26 19:10:11 +03:00
Disable remove button in replacement set panel when nothing is selected
This commit is contained in:
parent
d9e3431864
commit
dafa1d07cb
@ -9,6 +9,7 @@ unreleased
|
||||
|
||||
- [beta] Synchronize the selection in the outline inspector with the current cursor position in the focused editor.
|
||||
- [beta] Replace with new one when the last replacement definition row was removed, instead of desabling the remove button.
|
||||
- [beta] Disable the remove button in replacement set panel when nothing is selected.
|
||||
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ final class ReplacementSetViewController: NSViewController, ReplacementSetPanelV
|
||||
private var replacementSet = ReplacementSet()
|
||||
private lazy var updateNotificationTask: Debouncer = Debouncer(delay: 1.0) { [weak self] in self?.notifyUpdate() }
|
||||
|
||||
@objc private dynamic var canRemove: Bool = true
|
||||
@objc private dynamic var canRemove: Bool = false
|
||||
@objc private dynamic var hasInvalidSetting = false
|
||||
@objc private dynamic var resultMessage: String?
|
||||
|
||||
@ -237,6 +237,16 @@ private extension NSPasteboard.PasteboardType {
|
||||
|
||||
extension ReplacementSetViewController: NSTableViewDelegate {
|
||||
|
||||
/// selection did change
|
||||
func tableViewSelectionDidChange(_ notification: Notification) {
|
||||
|
||||
guard let tableView = self.tableView else { return }
|
||||
|
||||
// update
|
||||
self.canRemove = tableView.selectedRow >= 0
|
||||
}
|
||||
|
||||
|
||||
/// make table cell view
|
||||
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user