8
8
//
9
9
// ---------------------------------------------------------------------------
10
10
//
11
- // © 2024 1024jp
11
+ // © 2024-2025 1024jp
12
12
//
13
13
// Licensed under the Apache License, Version 2.0 (the "License");
14
14
// you may not use this file except in compliance with the License.
@@ -28,23 +28,6 @@ import AppKit
28
28
// -> Pass all possible actions manually since NSDocument has no next responder (2024-05, macOS 14)
29
29
extension DirectoryDocument {
30
30
31
- override func validateMenuItem( _ menuItem: NSMenuItem ) -> Bool {
32
-
33
- switch menuItem. action {
34
- case #selector( changeEncoding) ,
35
- #selector( changeLineEnding) ,
36
- #selector( changeSyntax) :
37
- return ( self . currentDocument as? Document ) ? . validateMenuItem ( menuItem) ?? false
38
-
39
- case #selector( showInFinder) :
40
- return self . currentDocument? . validateMenuItem ( menuItem) ?? false
41
-
42
- default :
43
- return super. validateMenuItem ( menuItem)
44
- }
45
- }
46
-
47
-
48
31
override func validateUserInterfaceItem( _ item: any NSValidatedUserInterfaceItem ) -> Bool {
49
32
50
33
switch item. action {
@@ -60,7 +43,10 @@ extension DirectoryDocument {
60
43
#selector( lock ( _: ) ) ,
61
44
#selector( unlock ( _: ) ) ,
62
45
#selector( runPageLayout) ,
63
- #selector( printDocument) :
46
+ #selector( printDocument) ,
47
+ #selector( changeEncoding) ,
48
+ #selector( changeLineEnding) ,
49
+ #selector( changeSyntax) :
64
50
// -> PreviewDocument doesn't support file manipulation.
65
51
return ( self . currentDocument as? Document ) ? . validateUserInterfaceItem ( item) ?? false
66
52
0 commit comments