From d85cab6ebee0c619b48489fe81ad2cea5fb0b6c1 Mon Sep 17 00:00:00 2001
From: 1024jp <1024jp@wolfrosch.com>
Date: Mon, 2 Mar 2015 01:47:49 +0900
Subject: [PATCH 01/20] Update version to 2.1.2-alpha
---
CotEditor/Info.plist | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CotEditor/Info.plist b/CotEditor/Info.plist
index 0194854646..aeff9b35a5 100644
--- a/CotEditor/Info.plist
+++ b/CotEditor/Info.plist
@@ -953,11 +953,11 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 2.1.1
+ 2.1.2 dev
CFBundleSignature
cEd1
CFBundleVersion
- 2.1.1
+ 2.1.2-alpha
LSApplicationCategoryType
public.app-category.productivity
NSAppleScriptEnabled
From 21591eae105ff5f5009c1a920482dcd40926f717 Mon Sep 17 00:00:00 2001
From: 1024jp <1024jp@wolfrosch.com>
Date: Mon, 2 Mar 2015 01:50:01 +0900
Subject: [PATCH 02/20] Change unnecessary atomic properties to nonatomic
---
CotEditor/Sources/CEDocument.m | 4 ++--
CotEditor/Sources/CESyntaxParser.m | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/CotEditor/Sources/CEDocument.m b/CotEditor/Sources/CEDocument.m
index 4f30308393..47541484c5 100644
--- a/CotEditor/Sources/CEDocument.m
+++ b/CotEditor/Sources/CEDocument.m
@@ -55,8 +55,8 @@ @interface CEDocument ()
@property (nonatomic) CEPrintPanelAccessoryController *printPanelAccessoryController;
-@property (atomic) BOOL needsShowUpdateAlertWithBecomeKey;
-@property (atomic, getter=isRevertingForExternalFileUpdate) BOOL revertingForExternalFileUpdate;
+@property (nonatomic) BOOL needsShowUpdateAlertWithBecomeKey;
+@property (nonatomic, getter=isRevertingForExternalFileUpdate) BOOL revertingForExternalFileUpdate;
@property (nonatomic) BOOL didAlertNotWritable; // 文書が読み込み専用のときにその警告を表示したかどうか
@property (nonatomic, copy) NSString *fileContentString; // string that is read from the document file
@property (nonatomic) CEODBEventSender *ODBEventSender;
diff --git a/CotEditor/Sources/CESyntaxParser.m b/CotEditor/Sources/CESyntaxParser.m
index c3fe020194..dd769a8d76 100644
--- a/CotEditor/Sources/CESyntaxParser.m
+++ b/CotEditor/Sources/CESyntaxParser.m
@@ -65,11 +65,11 @@ @interface CESyntaxParser ()
@property (nonatomic) CELayoutManager *layoutManager;
@property (nonatomic) BOOL hasSyntaxHighlighting;
-@property (atomic, copy) NSDictionary *coloringDictionary;
-@property (atomic, copy) NSDictionary *simpleWordsCharacterSets;
-@property (atomic, copy) NSDictionary *pairedQuoteTypes; // dict for quote pair to extract with comment
-@property (atomic, copy) NSArray *cacheColorings; // extracted results cache of the last whole string coloring
-@property (atomic, copy) NSString *cacheHash; // MD5 hash
+@property (nonatomic, copy) NSDictionary *coloringDictionary;
+@property (nonatomic, copy) NSDictionary *simpleWordsCharacterSets;
+@property (nonatomic, copy) NSDictionary *pairedQuoteTypes; // dict for quote pair to extract with comment
+@property (nonatomic, copy) NSArray *cacheColorings; // extracted results cache of the last whole string coloring
+@property (nonatomic, copy) NSString *cacheHash; // MD5 hash
@property (atomic) CEIndicatorSheetController *indicatorController;
From 02f2d176572b1cd0af2c3b0e791ee6ee3383df86 Mon Sep 17 00:00:00 2001
From: 1024jp <1024jp@wolfrosch.com>
Date: Mon, 2 Mar 2015 19:22:55 +0900
Subject: [PATCH 03/20] Add "Cyrillic (Windows)" to encoding list (close #360)
---
CHANGELOG.md | 9 +++++++++
CotEditor/Sources/constants.m | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7df916493e..64ea582db3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,15 @@
Change Log
==========================
+2.1.2
+--------------------------
+
+### Additions/Changes
+
+- Add “Cyrillic (Windows)” to the encoding list.
+
+
+
2.1.1
--------------------------
diff --git a/CotEditor/Sources/constants.m b/CotEditor/Sources/constants.m
index 59237e3f00..dc4ca44cc2 100644
--- a/CotEditor/Sources/constants.m
+++ b/CotEditor/Sources/constants.m
@@ -453,6 +453,7 @@ BOOL CEIsAlmostEqualCGFloats(CGFloat float1, CGFloat float2) {
kCFStringEncodingISOLatinGreek, // Greek (ISO 8859-7)
kCFStringEncodingMacCyrillic, // Cyrillic (Mac OS)
kCFStringEncodingISOLatinCyrillic, // Cyrillic (ISO 8859-5)
+ kCFStringEncodingWindowsCyrillic, // Cyrillic (Windows)
kCFStringEncodingMacCentralEurRoman, // Central European (Mac OS)
kCFStringEncodingMacTurkish, // Turkish (Mac OS)
kCFStringEncodingMacIcelandic, // Icelandic (Mac OS)
@@ -470,7 +471,6 @@ BOOL CEIsAlmostEqualCGFloats(CGFloat float1, CGFloat float2) {
kCFStringEncodingNonLossyASCII, // Non-lossy ASCII
kCFStringEncodingInvalidId, // ----------
- // Encodings available 10.4 and later (CotEditor added in 0.8.0)
kCFStringEncodingUTF16BE, // Unicode (UTF-16BE)
kCFStringEncodingUTF16LE, // Unicode (UTF-16LE)
kCFStringEncodingUTF32, // Unicode (UTF-32)
@@ -492,6 +492,7 @@ BOOL CEIsAlmostEqualCGFloats(CGFloat float1, CGFloat float2) {
kCFStringEncodingISOLatinGreek, // Greek (ISO 8859-7)
kCFStringEncodingMacCyrillic, // Cyrillic (Mac OS)
kCFStringEncodingISOLatinCyrillic, // Cyrillic (ISO 8859-5)
+ kCFStringEncodingWindowsCyrillic, // Cyrillic (Windows)
kCFStringEncodingMacCentralEurRoman, // Central European (Mac OS)
kCFStringEncodingISOLatin2, // Central European (ISO Latin 2)
kCFStringEncodingISOLatin3, // Western (ISO Latin 3)
From 5bc7de28f91cd11713a5d8917313bf31129a23e6 Mon Sep 17 00:00:00 2001
From: 1024jp <1024jp@wolfrosch.com>
Date: Tue, 3 Mar 2015 03:47:15 +0900
Subject: [PATCH 04/20] Avoid sending ODB Editor notification on autosaving
---
CotEditor/Sources/CEDocument.m | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/CotEditor/Sources/CEDocument.m b/CotEditor/Sources/CEDocument.m
index 47541484c5..619cefddbe 100644
--- a/CotEditor/Sources/CEDocument.m
+++ b/CotEditor/Sources/CEDocument.m
@@ -247,7 +247,9 @@ - (BOOL)writeSafelyToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperati
[self getFileAttributes];
// 外部エディタプロトコル(ODB Editor Suite)のファイル更新通知送信
- [[self ODBEventSender] sendModifiedEventWithURL:url operation:saveOperation];
+ if (saveOperation != NSAutosaveElsewhereOperation) {
+ [[self ODBEventSender] sendModifiedEventWithURL:url operation:saveOperation];
+ }
// changeCountを更新
[self updateChangeCountWithToken:token forSaveOperation:saveOperation];
From 98b587fe359c0d3ca9f8001eccb100221ae99095 Mon Sep 17 00:00:00 2001
From: 1024jp <1024jp@wolfrosch.com>
Date: Tue, 3 Mar 2015 03:54:06 +0900
Subject: [PATCH 05/20] Save backup files always in
NSAutosavedInformationDirectory (close #362)
---
CHANGELOG.md | 1 +
CotEditor/Sources/CEDocument.m | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 64ea582db3..ad7d042abb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ Change Log
### Additions/Changes
+- Change please to create backup files (Now, backup files are always created in `~/Library/Autosave Information/`).
- Add “Cyrillic (Windows)” to the encoding list.
diff --git a/CotEditor/Sources/CEDocument.m b/CotEditor/Sources/CEDocument.m
index 619cefddbe..cf49944854 100644
--- a/CotEditor/Sources/CEDocument.m
+++ b/CotEditor/Sources/CEDocument.m
@@ -224,6 +224,29 @@ - (NSData *)dataOfType:(NSString *)typeName error:(NSError *__autoreleasing *)ou
}
+// ------------------------------------------------------
+/// modify place to create backup file
+- (void)saveToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation completionHandler:(void (^)(NSError *))completionHandler
+// ------------------------------------------------------
+{
+ // save backup file always in `~/Library/Autosaved Information/` direcotory
+ // (The default backup URL is the same directory as the fileURL.)
+ if (saveOperation == NSAutosaveElsewhereOperation && [self fileURL]) {
+ NSURL *autosaveDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSAutosavedInformationDirectory
+ inDomain:NSUserDomainMask
+ appropriateForURL:nil
+ create:YES
+ error:nil];
+ NSString *baseFileName = [[self fileURL] lastPathComponent];
+ NSString *fileName = [NSString stringWithFormat:@"%@ (%p)", [baseFileName stringByDeletingPathExtension], self]; // append a unique string to avoid overwriting another backup file with the same file name.
+
+ url = [[autosaveDirectoryURL URLByAppendingPathComponent:fileName] URLByAppendingPathExtension:[baseFileName pathExtension]];
+ }
+
+ [super saveToURL:url ofType:typeName forSaveOperation:saveOperation completionHandler:completionHandler];
+}
+
+
// ------------------------------------------------------
/// ファイルの保存(保存処理で包括的に呼ばれる)
- (BOOL)writeSafelyToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError *__autoreleasing *)outError
From 847c636154eb4faf147a92fe55e1c73ac92cd6f1 Mon Sep 17 00:00:00 2001
From: 1024jp <1024jp@wolfrosch.com>
Date: Tue, 3 Mar 2015 16:43:13 +0900
Subject: [PATCH 06/20] Fix a typo in CHANGELOG
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ad7d042abb..0a4e205756 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@ Change Log
### Additions/Changes
-- Change please to create backup files (Now, backup files are always created in `~/Library/Autosave Information/`).
+- Change place to create backup files (Now, backup files are always created in `~/Library/Autosave Information/`).
- Add “Cyrillic (Windows)” to the encoding list.
From 661387d0f56aa01526f0a34303dac9ffb1aa4645 Mon Sep 17 00:00:00 2001
From: 1024jp <1024jp@wolfrosch.com>
Date: Thu, 5 Mar 2015 01:03:56 +0900
Subject: [PATCH 07/20] Use NSTextView subclass in find panel (close #363)
---
CHANGELOG.md | 3 +
CotEditor/Base.lproj/FindPanel.xib | 192 +++++++++++-------
CotEditor/CotEditor.xcodeproj/project.pbxproj | 18 +-
CotEditor/Sources/CEFindPanelTextClipView.h | 35 ++++
...tFieldCell.m => CEFindPanelTextClipView.m} | 20 +-
...dTextFieldCell.h => CEFindPanelTextView.h} | 6 +-
CotEditor/Sources/CEFindPanelTextView.m | 138 +++++++++++++
CotEditor/ja.lproj/FindPanel.strings | 8 +-
CotEditor/zh-Hans.lproj/FindPanel.strings | 8 +-
9 files changed, 325 insertions(+), 103 deletions(-)
create mode 100644 CotEditor/Sources/CEFindPanelTextClipView.h
rename CotEditor/Sources/{CEFindTextFieldCell.m => CEFindPanelTextClipView.m} (76%)
rename CotEditor/Sources/{CEFindTextFieldCell.h => CEFindPanelTextView.h} (90%)
create mode 100644 CotEditor/Sources/CEFindPanelTextView.m
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a4e205756..a03e367421 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,9 @@ Change Log
### Additions/Changes
- Change place to create backup files (Now, backup files are always created in `~/Library/Autosave Information/`).
+- Improve find panel:
+ - Add scroll bars to the text fields.
+ - Now, “Swap Yen and backslash keys” option is also applied to the fields in the find panel.
- Add “Cyrillic (Windows)” to the encoding list.
diff --git a/CotEditor/Base.lproj/FindPanel.xib b/CotEditor/Base.lproj/FindPanel.xib
index 882cde4e1b..27b9898553 100644
--- a/CotEditor/Base.lproj/FindPanel.xib
+++ b/CotEditor/Base.lproj/FindPanel.xib
@@ -15,7 +15,7 @@
-
+
@@ -27,48 +27,89 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Replace
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Find
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
- Find
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Replace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
@@ -657,7 +697,7 @@
-
+
diff --git a/CotEditor/CotEditor.xcodeproj/project.pbxproj b/CotEditor/CotEditor.xcodeproj/project.pbxproj
index 7832dc2d15..2d1ef537bd 100644
--- a/CotEditor/CotEditor.xcodeproj/project.pbxproj
+++ b/CotEditor/CotEditor.xcodeproj/project.pbxproj
@@ -24,7 +24,6 @@
25B2C24407FA68D100F4EFC7 /* CEBorderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 25B2C24207FA68D100F4EFC7 /* CEBorderView.m */; };
25B2C24D07FA6BC400F4EFC7 /* CETextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 25B2C24B07FA6BC400F4EFC7 /* CETextView.m */; };
2A009ACB1A57BA8B00C3D542 /* CETextFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A009ACA1A57BA8B00C3D542 /* CETextFinder.m */; };
- 2A009ACE1A587B3100C3D542 /* CEFindTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A009ACD1A587B3100C3D542 /* CEFindTextFieldCell.m */; };
2A009AD11A58ED1D00C3D542 /* CEFindResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A009AD01A58ED1D00C3D542 /* CEFindResultViewController.m */; };
2A009ADA1A5AAE8000C3D542 /* CEFindPanelSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A009AD91A5AAE8000C3D542 /* CEFindPanelSplitView.m */; };
2A07202B18E0E1C2006F3A43 /* CEPrintPanelAccessoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A07202A18E0E1C2006F3A43 /* CEPrintPanelAccessoryController.m */; };
@@ -123,6 +122,8 @@
2AD318C31A462C30001B8112 /* CEIntegrationPaneController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD318C21A462C30001B8112 /* CEIntegrationPaneController.m */; };
2AD4599B19DDCF6600A20FBB /* CEScriptMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD4599A19DDCF6600A20FBB /* CEScriptMenuItem.m */; };
2AD5322A19779FD000A925CA /* CELineHeightTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD5322919779FD000A925CA /* CELineHeightTransformer.m */; };
+ 2AD67C241AA7285F0078BB95 /* CEFindPanelTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD67C231AA7285F0078BB95 /* CEFindPanelTextView.m */; };
+ 2AD67C2A1AA75E7F0078BB95 /* CEFindPanelTextClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD67C291AA75E7F0078BB95 /* CEFindPanelTextClipView.m */; };
2AD84CAA1966314100DE49BD /* CEODBEventSender.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AD84CA91966314100DE49BD /* CEODBEventSender.m */; };
2AE2E9D519D2CF00000D66A9 /* CEEncodingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE2E9D419D2CF00000D66A9 /* CEEncodingManager.m */; };
2AE356461A86D32500E29FEF /* CEClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AE356451A86D32500E29FEF /* CEClipView.m */; };
@@ -246,8 +247,6 @@
25B2C24B07FA6BC400F4EFC7 /* CETextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CETextView.m; sourceTree = ""; };
2A009AC91A57BA8B00C3D542 /* CETextFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CETextFinder.h; sourceTree = ""; };
2A009ACA1A57BA8B00C3D542 /* CETextFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CETextFinder.m; sourceTree = ""; };
- 2A009ACC1A587B3100C3D542 /* CEFindTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindTextFieldCell.h; sourceTree = ""; };
- 2A009ACD1A587B3100C3D542 /* CEFindTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFindTextFieldCell.m; sourceTree = ""; };
2A009ACF1A58ED1D00C3D542 /* CEFindResultViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindResultViewController.h; sourceTree = ""; };
2A009AD01A58ED1D00C3D542 /* CEFindResultViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFindResultViewController.m; sourceTree = ""; };
2A009AD81A5AAE7F00C3D542 /* CEFindPanelSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindPanelSplitView.h; sourceTree = ""; };
@@ -484,6 +483,10 @@
2AD488721A085D8B00B795CB /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/SyntaxEditSheet.strings; sourceTree = ""; };
2AD5322819779FD000A925CA /* CELineHeightTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CELineHeightTransformer.h; sourceTree = ""; };
2AD5322919779FD000A925CA /* CELineHeightTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CELineHeightTransformer.m; sourceTree = ""; };
+ 2AD67C221AA7285F0078BB95 /* CEFindPanelTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindPanelTextView.h; sourceTree = ""; };
+ 2AD67C231AA7285F0078BB95 /* CEFindPanelTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFindPanelTextView.m; sourceTree = ""; };
+ 2AD67C281AA75E7F0078BB95 /* CEFindPanelTextClipView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEFindPanelTextClipView.h; sourceTree = ""; };
+ 2AD67C291AA75E7F0078BB95 /* CEFindPanelTextClipView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEFindPanelTextClipView.m; sourceTree = ""; };
2AD84CA81966314100DE49BD /* CEODBEventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEODBEventSender.h; sourceTree = ""; };
2AD84CA91966314100DE49BD /* CEODBEventSender.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEODBEventSender.m; sourceTree = ""; };
2AE2E9D319D2CF00000D66A9 /* CEEncodingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEEncodingManager.h; sourceTree = ""; };
@@ -605,8 +608,8 @@
children = (
2A009AD81A5AAE7F00C3D542 /* CEFindPanelSplitView.h */,
2A009AD91A5AAE8000C3D542 /* CEFindPanelSplitView.m */,
- 2A009ACC1A587B3100C3D542 /* CEFindTextFieldCell.h */,
- 2A009ACD1A587B3100C3D542 /* CEFindTextFieldCell.m */,
+ 2AD67C281AA75E7F0078BB95 /* CEFindPanelTextClipView.h */,
+ 2AD67C291AA75E7F0078BB95 /* CEFindPanelTextClipView.m */,
);
name = Views;
sourceTree = "";
@@ -1038,6 +1041,8 @@
2A7CF2421A5747EC00D09249 /* CEFindPanelController.m */,
2A009ACF1A58ED1D00C3D542 /* CEFindResultViewController.h */,
2A009AD01A58ED1D00C3D542 /* CEFindResultViewController.m */,
+ 2AD67C221AA7285F0078BB95 /* CEFindPanelTextView.h */,
+ 2AD67C231AA7285F0078BB95 /* CEFindPanelTextView.m */,
2A009ADB1A5AB96F00C3D542 /* Views */,
);
name = "Text Finder";
@@ -1413,6 +1418,7 @@
8CB0122E07CA0EFA00221EDC /* CEToolbarController.m in Sources */,
258D708A07D456DF0062A3E5 /* CETextSelection.m in Sources */,
8CC1925707E2D84500B54AE4 /* CEDocument+ScriptingSupport.m in Sources */,
+ 2AD67C241AA7285F0078BB95 /* CEFindPanelTextView.m in Sources */,
2A63122E19C2D30C0088C5C6 /* CEThemeViewController.m in Sources */,
8CC1961D07E2E54E00B54AE4 /* CEScriptManager.m in Sources */,
2AACC9591942A82900E3FF63 /* CEIndicatorSheetController.m in Sources */,
@@ -1430,10 +1436,10 @@
2A07202B18E0E1C2006F3A43 /* CEPrintPanelAccessoryController.m in Sources */,
2A3A759419E77D66001DAB88 /* CEMigrationWindowController.m in Sources */,
2A51793A1A40A3B500A3F852 /* CEShortcutKeyField.m in Sources */,
+ 2AD67C2A1AA75E7F0078BB95 /* CEFindPanelTextClipView.m in Sources */,
2A7846DE18FE0C0C006BDF00 /* CETheme.m in Sources */,
2A68F93818FB04F400673440 /* CEMenuItemCell.m in Sources */,
2AB432711912AF7200835004 /* CEGlyphPopoverController.m in Sources */,
- 2A009ACE1A587B3100C3D542 /* CEFindTextFieldCell.m in Sources */,
2AE356461A86D32500E29FEF /* CEClipView.m in Sources */,
2AFFB71B18D7F18300118477 /* CEGoToSheetController.m in Sources */,
2A3FB2AD18ECEFF200D9CB2C /* CESyntaxEditSheetController.m in Sources */,
diff --git a/CotEditor/Sources/CEFindPanelTextClipView.h b/CotEditor/Sources/CEFindPanelTextClipView.h
new file mode 100644
index 0000000000..51553074f4
--- /dev/null
+++ b/CotEditor/Sources/CEFindPanelTextClipView.h
@@ -0,0 +1,35 @@
+/*
+ ==============================================================================
+ CEFindPanelTextClipView
+
+ CotEditor
+ http://coteditor.com
+
+ Created on 2015-03-05 by 1024jp
+ encoding="UTF-8"
+ ------------------------------------------------------------------------------
+
+ © 2015 1024jp
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ ==============================================================================
+ */
+
+@import Cocoa;
+
+
+@interface CEFindPanelTextClipView : NSClipView
+
+@end
diff --git a/CotEditor/Sources/CEFindTextFieldCell.m b/CotEditor/Sources/CEFindPanelTextClipView.m
similarity index 76%
rename from CotEditor/Sources/CEFindTextFieldCell.m
rename to CotEditor/Sources/CEFindPanelTextClipView.m
index 46e43fea6b..ed7d339aa7 100644
--- a/CotEditor/Sources/CEFindTextFieldCell.m
+++ b/CotEditor/Sources/CEFindPanelTextClipView.m
@@ -1,11 +1,11 @@
/*
==============================================================================
- CEFindTextFieldCell
+ CEFindPanelTextClipView
CotEditor
http://coteditor.com
- Created on 2015-01-03 by 1024jp
+ Created on 2015-03-05 by 1024jp
encoding="UTF-8"
------------------------------------------------------------------------------
@@ -27,24 +27,24 @@
==============================================================================
*/
-#import "CEFindTextFieldCell.h"
+#import "CEFindPanelTextClipView.h"
-@implementation CEFindTextFieldCell
+@implementation CEFindPanelTextClipView
#pragma mark Superclass Methods
// ------------------------------------------------------
-/// add left padding for history popup
-- (NSRect)drawingRectForBounds:(NSRect)theRect
+/// add left padding for popup button
+- (void)setFrame:(NSRect)frame
// ------------------------------------------------------
{
- const CGFloat padding = 28;
+ const CGFloat padding = 28.0;
- theRect.size.width -= padding;
- theRect.origin.x += padding;
+ frame.origin.x += padding;
+ frame.size.width -= padding;
- return [super drawingRectForBounds:theRect];
+ [super setFrame:frame];
}
@end
diff --git a/CotEditor/Sources/CEFindTextFieldCell.h b/CotEditor/Sources/CEFindPanelTextView.h
similarity index 90%
rename from CotEditor/Sources/CEFindTextFieldCell.h
rename to CotEditor/Sources/CEFindPanelTextView.h
index 08b009edc0..26f9dfbb05 100644
--- a/CotEditor/Sources/CEFindTextFieldCell.h
+++ b/CotEditor/Sources/CEFindPanelTextView.h
@@ -1,11 +1,11 @@
/*
==============================================================================
- CEFindTextFieldCell
+ CEFindPanelTextView
CotEditor
http://coteditor.com
- Created on 2015-01-03 by 1024jp
+ Created on 2015-03-04 by 1024jp
encoding="UTF-8"
------------------------------------------------------------------------------
@@ -30,6 +30,6 @@
@import Cocoa;
-@interface CEFindTextFieldCell : NSTextFieldCell
+@interface CEFindPanelTextView : NSTextView
@end
diff --git a/CotEditor/Sources/CEFindPanelTextView.m b/CotEditor/Sources/CEFindPanelTextView.m
new file mode 100644
index 0000000000..f0d33f3958
--- /dev/null
+++ b/CotEditor/Sources/CEFindPanelTextView.m
@@ -0,0 +1,138 @@
+/*
+ ==============================================================================
+ CEFindPanelTextView
+
+ CotEditor
+ http://coteditor.com
+
+ Created on 2015-03-04 by 1024jp
+ encoding="UTF-8"
+ ------------------------------------------------------------------------------
+
+ © 2015 1024jp
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ ==============================================================================
+ */
+
+#import "CEFindPanelTextView.h"
+#import "CEFindPanelController.h"
+#import "constants.h"
+
+
+@interface CEFindPanelTextView ()
+
+@property (nonatomic) IBOutlet CEFindPanelController *findPanelController;
+
+@end
+
+
+
+
+#pragma mark -
+
+@implementation CEFindPanelTextView
+
+#pragma mark Superclass Methods
+
+// ------------------------------------------------------
+/// initialize instance
+- (instancetype)initWithCoder:(NSCoder *)coder
+// ------------------------------------------------------
+{
+ self = [super initWithCoder:coder];
+ if (self) {
+ // set system font (standard NSTextField behavior)
+ NSFont *font = [NSFont systemFontOfSize:[NSFont systemFontSize]];
+ [self setFont:font];
+
+ // set inset a bit like NSTextField (horizontal inset is added in CEFindPanelTextClipView)
+ [self setTextContainerInset:NSMakeSize(0.0, 2.0)];
+
+ // avoid wrapping
+ [[self textContainer] setWidthTracksTextView:NO];
+ [[self textContainer] setContainerSize:NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX)];
+ [self setHorizontallyResizable:YES];
+ }
+ return self;
+}
+
+
+// ------------------------------------------------------
+/// view is on focus
+- (BOOL)becomeFirstResponder
+// ------------------------------------------------------
+{
+ // select whole string on focus (standard NSTextField behavior)
+ [self setSelectedRange:NSMakeRange(0, [[self string] length])];
+
+ return [super becomeFirstResponder];
+}
+
+
+// ------------------------------------------------------
+/// view dismiss focus
+- (BOOL)resignFirstResponder
+// ------------------------------------------------------
+{
+ // clear current selection (standard NSTextField behavior)
+ [self setSelectedRange:NSMakeRange(0, 0)];
+ return [super resignFirstResponder];
+}
+
+
+// ------------------------------------------------------
+/// swap '¥' with '\' if needed
+- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
+// ------------------------------------------------------
+{
+ NSString *string = ([aString isKindOfClass:[NSAttributedString class]]) ? [aString string] : aString;
+
+ // swap '¥' with '\' if needed
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:CEDefaultSwapYenAndBackSlashKey] && ([string length] == 1)) {
+ NSString *yen = [NSString stringWithCharacters:&kYenMark length:1];
+
+ if ([string isEqualToString:@"\\"]) {
+ string = yen;
+ } else if ([string isEqualToString:yen]) {
+ string = @"\\";
+ }
+ }
+
+ [super insertText:string replacementRange:replacementRange];
+}
+
+
+// ------------------------------------------------------
+/// jump to the next responder with tab key (standard NSTextField behavior)
+- (void)insertTab:(id)sender
+// ------------------------------------------------------
+{
+ [[self window] makeFirstResponder:[self nextKeyView]];
+}
+
+
+// ------------------------------------------------------
+/// perform Find Next with return
+- (void)insertNewline:(id)sender
+// ------------------------------------------------------
+{
+ // -> do nothing if no findpanelController is connected (standard NSTextField behavior)
+ if ([self findPanelController]) {
+ [[self findPanelController] findNext:self];
+ }
+}
+
+@end
diff --git a/CotEditor/ja.lproj/FindPanel.strings b/CotEditor/ja.lproj/FindPanel.strings
index 7ca0da7c52..88c2bc23c4 100644
--- a/CotEditor/ja.lproj/FindPanel.strings
+++ b/CotEditor/ja.lproj/FindPanel.strings
@@ -15,10 +15,10 @@
/* Class = "NSPanel"; title = "Find & Replace"; ObjectID = "Wal-Sg-6d6"; */
"Wal-Sg-6d6.title" = "検索と置換";
-/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Find"; ObjectID = "KFJ-K2-zGh"; */
-"KFJ-K2-zGh.ibShadowedIsNilPlaceholder" = "検索";
-/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Replace"; ObjectID = "rCp-kT-O6b"; */
-"rCp-kT-O6b.ibShadowedIsNilPlaceholder" = "置換";
+/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Find"; ObjectID = "oNs-q5-oCH"; */
+"oNs-q5-oCH.ibShadowedIsNilPlaceholder" = "検索";
+/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Replace"; ObjectID = "zd8-iN-ws4"; */
+"zd8-iN-ws4.ibShadowedIsNilPlaceholder" = "置換";
/* Class = "NSButtonCell"; title = "Regular Expression"; ObjectID = "brT-HP-GVL"; */
"brT-HP-GVL.title" = "正規表現";
diff --git a/CotEditor/zh-Hans.lproj/FindPanel.strings b/CotEditor/zh-Hans.lproj/FindPanel.strings
index 3c9931c443..150dfd08f6 100644
--- a/CotEditor/zh-Hans.lproj/FindPanel.strings
+++ b/CotEditor/zh-Hans.lproj/FindPanel.strings
@@ -16,10 +16,10 @@
/* Class = "NSPanel"; title = "Find & Replace"; ObjectID = "Wal-Sg-6d6"; */
"Wal-Sg-6d6.title" = "查找 & 替换";
-/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Find"; ObjectID = "KFJ-K2-zGh"; */
-"KFJ-K2-zGh.ibShadowedIsNilPlaceholder" = "查找";
-/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Replace"; ObjectID = "rCp-kT-O6b"; */
-"rCp-kT-O6b.ibShadowedIsNilPlaceholder" = "替换";
+/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Find"; ObjectID = "oNs-q5-oCH"; */
+"oNs-q5-oCH.ibShadowedIsNilPlaceholder" = "查找";
+/* Class = "IBBindingConnection"; ibShadowedIsNilPlaceholder = "Replace"; ObjectID = "zd8-iN-ws4"; */
+"zd8-iN-ws4.ibShadowedIsNilPlaceholder" = "替换";
/* Class = "NSButtonCell"; title = "Regular Expression"; ObjectID = "brT-HP-GVL"; */
"brT-HP-GVL.title" = "正则表达式";
From 2732985c09215880f4d8eae19cf1fd08c0ca6524 Mon Sep 17 00:00:00 2001
From: 1024jp <1024jp@wolfrosch.com>
Date: Thu, 5 Mar 2015 01:04:15 +0900
Subject: [PATCH 08/20] Remove escape character option from find panel (#363)
---
CHANGELOG.md | 1 +
CotEditor/Base.lproj/FindPanel.xib | 18 ----------------
CotEditor/Sources/CEFindPanelController.m | 25 +++--------------------
CotEditor/Sources/CETextFinder.m | 1 -
CotEditor/Sources/constants.h | 1 -
CotEditor/Sources/constants.m | 1 -
CotEditor/ja.lproj/FindPanel.strings | 5 -----
CotEditor/zh-Hans.lproj/FindPanel.strings | 5 -----
8 files changed, 4 insertions(+), 53 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a03e367421..18c653ff09 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ Change Log
- Improve find panel:
- Add scroll bars to the text fields.
- Now, “Swap Yen and backslash keys” option is also applied to the fields in the find panel.
+ - Remove “Escape Character” option for regular expression search.
- Add “Cyrillic (Windows)” to the encoding list.
diff --git a/CotEditor/Base.lproj/FindPanel.xib b/CotEditor/Base.lproj/FindPanel.xib
index 27b9898553..dc995a9e62 100644
--- a/CotEditor/Base.lproj/FindPanel.xib
+++ b/CotEditor/Base.lproj/FindPanel.xib
@@ -238,24 +238,6 @@
-