CutBox.app

Coverage Report

Created: 2024-03-12 03:40

.../Source/App/SearchAndPreview/SearchViewTextViewDelegate.swift
Line
Count
Source
1
//
2
//  SearchViewTextViewDelegate.swift
3
//  CutBox
4
//
5
//  Created by Jason Milkins on 31/3/18
6
//  Copyright © 2018-2023 ocodo. All rights reserved.
7
//
8
9
import Cocoa
10
11
extension SearchAndPreviewView: NSTextViewDelegate, NSTextFieldDelegate {
12
13
1
    func textDidChange(_ notification: Notification) {
14
1
        if notification.object as? SearchTextView == self.searchText {
15
1
            self.filterTextPublisher.onNext(self.searchText.string)
16
1
        }
17
1
    }
18
19
10
    func textView(_ textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool {
20
10
        return useTextCommands.contains(commandSelector)
21
10
    }
22
23
10
    func control(_ control: NSControl, textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool {
24
10
        return useTextCommands.contains(commandSelector)
25
10
    }
26
}