diff --git a/MacNeovim/Info.plist b/MacNeovim/Info.plist index 05508321..5b1897c0 100644 --- a/MacNeovim/Info.plist +++ b/MacNeovim/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-193 + SNAPSHOT-195 CFBundleVersion - 193 + 195 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/OutlineViewTest/Info.plist b/OutlineViewTest/Info.plist index e60b1496..d0855670 100644 --- a/OutlineViewTest/Info.plist +++ b/OutlineViewTest/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-193 + SNAPSHOT-195 CFBundleVersion - 193 + 195 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/SwiftNeoVim/Info.plist b/SwiftNeoVim/Info.plist index 4927c453..aab7003a 100644 --- a/SwiftNeoVim/Info.plist +++ b/SwiftNeoVim/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - SNAPSHOT-193 + SNAPSHOT-195 CFBundleSignature ???? CFBundleVersion - 193 + 195 NSHumanReadableCopyright Copyright © 2016 Tae Won Ha. All rights reserved. NSPrincipalClass diff --git a/SwiftNeoVim/KeyUtils.swift b/SwiftNeoVim/KeyUtils.swift index 0d948fcb..5b386982 100644 --- a/SwiftNeoVim/KeyUtils.swift +++ b/SwiftNeoVim/KeyUtils.swift @@ -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", +] diff --git a/SwiftNeoVim/NeoVimView.swift b/SwiftNeoVim/NeoVimView.swift index 25941c08..45444ad6 100644 --- a/SwiftNeoVim/NeoVimView.swift +++ b/SwiftNeoVim/NeoVimView.swift @@ -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 } diff --git a/SwiftNeoVimTests/Info.plist b/SwiftNeoVimTests/Info.plist index 65d3bbf8..839c531f 100644 --- a/SwiftNeoVimTests/Info.plist +++ b/SwiftNeoVimTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - SNAPSHOT-193 + SNAPSHOT-195 CFBundleSignature ???? CFBundleVersion - 193 + 195 diff --git a/VimR-Workspace-Demo/Info.plist b/VimR-Workspace-Demo/Info.plist index d5fcba19..280e1777 100644 --- a/VimR-Workspace-Demo/Info.plist +++ b/VimR-Workspace-Demo/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-193 + SNAPSHOT-195 CFBundleSignature ???? CFBundleVersion - 193 + 195 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/VimR.xcodeproj/project.pbxproj b/VimR.xcodeproj/project.pbxproj index 685f0156..9583a520 100644 --- a/VimR.xcodeproj/project.pbxproj +++ b/VimR.xcodeproj/project.pbxproj @@ -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; diff --git a/VimR/FileOutlineView.swift b/VimR/FileOutlineView.swift index acbdaa52..a6641b0f 100644 --- a/VimR/FileOutlineView.swift +++ b/VimR/FileOutlineView.swift @@ -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 diff --git a/VimR/Info.plist b/VimR/Info.plist index 38396b75..f6a98036 100644 --- a/VimR/Info.plist +++ b/VimR/Info.plist @@ -32,7 +32,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - SNAPSHOT-193 + SNAPSHOT-195 CFBundleSignature ???? CFBundleURLTypes @@ -49,7 +49,7 @@ CFBundleVersion - 193 + 195 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/VimR/MainWindow.swift b/VimR/MainWindow.swift index e5d28441..095a0b77 100644 --- a/VimR/MainWindow.swift +++ b/VimR/MainWindow.swift @@ -241,10 +241,6 @@ class MainWindow: NSObject, self.windowController.showWindow(self) } - func closeAllNeoVimWindowsWithoutSaving() { - self.neoVimView.closeAllWindowsWithoutSaving() - } - fileprivate let emit: (UuidAction) -> 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 diff --git a/VimRTests/Info.plist b/VimRTests/Info.plist index 65d3bbf8..839c531f 100644 --- a/VimRTests/Info.plist +++ b/VimRTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - SNAPSHOT-193 + SNAPSHOT-195 CFBundleSignature ???? CFBundleVersion - 193 + 195 diff --git a/appcast_snapshot.xml b/appcast_snapshot.xml index ce32a030..280168cf 100644 --- a/appcast_snapshot.xml +++ b/appcast_snapshot.xml @@ -7,22 +7,22 @@ Most recent changes with links to updates for VimR. en - SNAPSHOT-193 + SNAPSHOT-195 -
  • GH-430: Bugfix: The cursor disappears when using arrow keys in the command mode.
  • +
  • GH-403, GH-447: Shift-Tab works (thanks to @mkhl)
  • ]]>
    - https://github.com/qvacua/vimr/releases/tag/snapshot/193 + https://github.com/qvacua/vimr/releases/tag/snapshot/195 - 2017-05-12T23:20:22.770207 + 2017-05-17T19:40:40.275108 10.10.0 -
    diff --git a/resources/release-notes.md b/resources/release-notes.md index e8819263..7f7b1450 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -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