1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-28 08:13:17 +03:00

Merge branch 'develop' into update-neovim

This commit is contained in:
Tae Won Ha 2017-05-17 22:00:24 +02:00
commit cca384fae4
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
14 changed files with 112 additions and 107 deletions

View File

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-193</string>
<string>SNAPSHOT-195</string>
<key>CFBundleVersion</key>
<string>193</string>
<string>195</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>

View File

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-193</string>
<string>SNAPSHOT-195</string>
<key>CFBundleVersion</key>
<string>193</string>
<string>195</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>

View File

@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-193</string>
<string>SNAPSHOT-195</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>193</string>
<string>195</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Tae Won Ha. All rights reserved.</string>
<key>NSPrincipalClass</key>

View File

@ -7,76 +7,75 @@ import Cocoa
class KeyUtils {
static let specialKeys = [
NSUpArrowFunctionKey: "Up",
NSDownArrowFunctionKey: "Down",
NSLeftArrowFunctionKey: "Left",
NSRightArrowFunctionKey: "Right",
NSInsertFunctionKey: "Insert",
0x7F: "BS", // "delete"-key
NSDeleteFunctionKey: "Del", // "Fn+delete"-key
NSHomeFunctionKey: "Home",
NSBeginFunctionKey: "Begin",
NSEndFunctionKey: "End",
NSPageUpFunctionKey: "PageUp",
NSPageDownFunctionKey: "PageDown",
NSHelpFunctionKey: "Help",
NSF1FunctionKey: "F1",
NSF2FunctionKey: "F2",
NSF3FunctionKey: "F3",
NSF4FunctionKey: "F4",
NSF5FunctionKey: "F5",
NSF6FunctionKey: "F6",
NSF7FunctionKey: "F7",
NSF8FunctionKey: "F8",
NSF9FunctionKey: "F9",
NSF10FunctionKey: "F10",
NSF11FunctionKey: "F11",
NSF12FunctionKey: "F12",
NSF13FunctionKey: "F13",
NSF14FunctionKey: "F14",
NSF15FunctionKey: "F15",
NSF16FunctionKey: "F16",
NSF17FunctionKey: "F17",
NSF18FunctionKey: "F18",
NSF19FunctionKey: "F19",
NSF20FunctionKey: "F20",
NSF21FunctionKey: "F21",
NSF22FunctionKey: "F22",
NSF23FunctionKey: "F23",
NSF24FunctionKey: "F24",
NSF25FunctionKey: "F25",
NSF26FunctionKey: "F26",
NSF27FunctionKey: "F27",
NSF28FunctionKey: "F28",
NSF29FunctionKey: "F29",
NSF30FunctionKey: "F30",
NSF31FunctionKey: "F31",
NSF32FunctionKey: "F32",
NSF33FunctionKey: "F33",
NSF34FunctionKey: "F34",
NSF35FunctionKey: "F35",
]
static func isSpecial(key: String) -> Bool {
guard key.characters.count == 1 else {
return false
}
if let firstChar = key.utf16.first {
return KeyUtils.specialKeys.keys.contains(Int(firstChar))
return specialKeys.keys.contains(Int(firstChar))
}
return false
}
static func namedKeyFrom(key: String) -> String {
if let firstChar = key.utf16.first {
if KeyUtils.specialKeys.keys.contains(Int(firstChar)) {
return KeyUtils.specialKeys[Int(firstChar)]!
}
if let firstChar = key.utf16.first, specialKeys.keys.contains(Int(firstChar)) {
return specialKeys[Int(firstChar)]!
}
return key
}
}
fileprivate let specialKeys = [
NSUpArrowFunctionKey: "Up",
NSDownArrowFunctionKey: "Down",
NSLeftArrowFunctionKey: "Left",
NSRightArrowFunctionKey: "Right",
NSInsertFunctionKey: "Insert",
0x7F: "BS", // "delete"-key
NSDeleteFunctionKey: "Del", // "Fn+delete"-key
NSHomeFunctionKey: "Home",
NSBeginFunctionKey: "Begin",
NSEndFunctionKey: "End",
NSPageUpFunctionKey: "PageUp",
NSPageDownFunctionKey: "PageDown",
NSHelpFunctionKey: "Help",
NSF1FunctionKey: "F1",
NSF2FunctionKey: "F2",
NSF3FunctionKey: "F3",
NSF4FunctionKey: "F4",
NSF5FunctionKey: "F5",
NSF6FunctionKey: "F6",
NSF7FunctionKey: "F7",
NSF8FunctionKey: "F8",
NSF9FunctionKey: "F9",
NSF10FunctionKey: "F10",
NSF11FunctionKey: "F11",
NSF12FunctionKey: "F12",
NSF13FunctionKey: "F13",
NSF14FunctionKey: "F14",
NSF15FunctionKey: "F15",
NSF16FunctionKey: "F16",
NSF17FunctionKey: "F17",
NSF18FunctionKey: "F18",
NSF19FunctionKey: "F19",
NSF20FunctionKey: "F20",
NSF21FunctionKey: "F21",
NSF22FunctionKey: "F22",
NSF23FunctionKey: "F23",
NSF24FunctionKey: "F24",
NSF25FunctionKey: "F25",
NSF26FunctionKey: "F26",
NSF27FunctionKey: "F27",
NSF28FunctionKey: "F28",
NSF29FunctionKey: "F29",
NSF30FunctionKey: "F30",
NSF31FunctionKey: "F31",
NSF32FunctionKey: "F32",
NSF33FunctionKey: "F33",
NSF34FunctionKey: "F34",
NSF35FunctionKey: "F35",
0x19: "Tab",
]

View File

@ -1036,6 +1036,7 @@ extension NeoVimView: NSTextInputClient {
let control = modifierFlags.contains(.control)
let option = modifierFlags.contains(.option)
let command = modifierFlags.contains(.command)
let shift = modifierFlags.contains(.shift)
if control {
result += "C-"
@ -1049,6 +1050,10 @@ extension NeoVimView: NSTextInputClient {
result += "D-"
}
if shift {
result += "S-"
}
if result.characters.count > 0 {
return result
}

View File

@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-193</string>
<string>SNAPSHOT-195</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>193</string>
<string>195</string>
</dict>
</plist>

View File

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-193</string>
<string>SNAPSHOT-195</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>193</string>
<string>195</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>

View File

@ -1693,7 +1693,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 193;
DYLIB_CURRENT_VERSION = 195;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -1718,7 +1718,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 193;
DYLIB_CURRENT_VERSION = 195;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -1955,7 +1955,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 193;
CURRENT_PROJECT_VERSION = 195;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@ -2005,7 +2005,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 193;
CURRENT_PROJECT_VERSION = 195;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;

View File

@ -39,9 +39,8 @@ class FileOutlineView: NSOutlineView,
self.doubleAction = #selector(FileOutlineView.doubleClickAction)
source
.filter { state in
return state.lastFileSystemUpdate.mark != self.lastFileSystemUpdateMark
}
.filter { !self.reloadData(for: $0) }
.filter { $0.lastFileSystemUpdate.mark != self.lastFileSystemUpdateMark }
.throttle(2 * FileMonitor.fileSystemEventsLatency + 1,
latest: true,
scheduler: SerialDispatchQueueScheduler(qos: .background))
@ -59,25 +58,14 @@ class FileOutlineView: NSOutlineView,
self.beFirstResponder()
}
var reloadData = false
if self.isShowHidden != state.fileBrowserShowHidden {
self.isShowHidden = state.fileBrowserShowHidden
reloadData = true
}
if state.cwd != self.cwd {
self.lastFileSystemUpdateMark = state.lastFileSystemUpdate.mark
self.root = FileBrowserItem(state.cwd)
reloadData = true
}
if reloadData {
self.lastFileSystemUpdateMark = state.lastFileSystemUpdate.mark
self.reloadData()
guard self.reloadData(for: state) else {
return
}
self.isShowHidden = state.fileBrowserShowHidden
self.lastFileSystemUpdateMark = state.lastFileSystemUpdate.mark
self.root = FileBrowserItem(state.cwd)
self.reloadData()
})
.disposed(by: self.disposeBag)
}
@ -128,6 +116,18 @@ class FileOutlineView: NSOutlineView,
fatalError("init(coder:) has not been implemented")
}
fileprivate func reloadData(for state: StateType) -> Bool {
if self.isShowHidden != state.fileBrowserShowHidden {
return true
}
if state.cwd != self.cwd {
return true
}
return false
}
fileprivate func update(_ url: URL) {
guard let fileBrowserItem = self.fileBrowserItem(with: url) else {
return

View File

@ -32,7 +32,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-193</string>
<string>SNAPSHOT-195</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>193</string>
<string>195</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>

View File

@ -241,10 +241,6 @@ class MainWindow: NSObject,
self.windowController.showWindow(self)
}
func closeAllNeoVimWindowsWithoutSaving() {
self.neoVimView.closeAllWindowsWithoutSaving()
}
fileprivate let emit: (UuidAction<Action>) -> Void
fileprivate let disposeBag = DisposeBag()
@ -284,6 +280,10 @@ class MainWindow: NSObject,
fileprivate var isClosing = false
fileprivate func closeAllNeoVimWindowsWithoutSaving() {
self.neoVimView.closeAllWindowsWithoutSaving()
}
fileprivate func updateNeoVimAppearance() {
self.neoVimView.font = self.defaultFont
self.neoVimView.linespacing = self.linespacing

View File

@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>SNAPSHOT-193</string>
<string>SNAPSHOT-195</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>193</string>
<string>195</string>
</dict>
</plist>

View File

@ -7,22 +7,22 @@
<description>Most recent changes with links to updates for VimR.</description>
<language>en</language>
<item>
<title>SNAPSHOT-193</title>
<title>SNAPSHOT-195</title>
<description><![CDATA[
<ul>
<li>GH-430: Bugfix: The cursor disappears when using arrow keys in the command mode.</li>
<li>GH-403, GH-447: <code>Shift-Tab</code> works (thanks to @mkhl)</li>
</ul>
]]></description>
<releaseNotesLink>
https://github.com/qvacua/vimr/releases/tag/snapshot/193
https://github.com/qvacua/vimr/releases/tag/snapshot/195
</releaseNotesLink>
<pubDate>2017-05-12T23:20:22.770207</pubDate>
<pubDate>2017-05-17T19:40:40.275108</pubDate>
<minimumSystemVersion>10.10.0</minimumSystemVersion>
<enclosure url="https://github.com/qvacua/vimr/releases/download/snapshot/193/VimR-SNAPSHOT-193.tar.bz2"
sparkle:version="193"
sparkle:shortVersionString="SNAPSHOT-193"
sparkle:dsaSignature="MC4CFQC1aDJi3Q89AC6a+d/EBdDNdpPQOQIVAIJ8w231RvNEZ25jXIeOAUuddkWK"
length="12372402"
<enclosure url="https://github.com/qvacua/vimr/releases/download/snapshot/195/VimR-SNAPSHOT-195.tar.bz2"
sparkle:version="195"
sparkle:shortVersionString="SNAPSHOT-195"
sparkle:dsaSignature="MC4CFQCwD/Vg2FqkoYzR1xmBgij6V9MuHgIVAKXOZ5TFeYY/yyCRm+0p5ymLVVE4"
length="12366293"
type="application/octet-stream"/>
</item>
</channel>

View File

@ -3,6 +3,7 @@
* GH-395: Bugfix: Massive file system changes in the working directory causes VimR to freeze.
* GH-430: Bugfix: The cursor disappears when using arrow keys in the command mode.
* GH-450: Mild file browser refactoring
* GH-403, GH-447: `Shift-Tab` works (thanks to @mkhl)
# 0.15.0-191