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

Merge remote-tracking branch 'origin/develop' into update-neovim

This commit is contained in:
Tae Won Ha 2017-08-16 17:51:37 +02:00
commit 295890d3fc
13 changed files with 93 additions and 59 deletions

View File

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

View File

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

View File

@ -7,6 +7,18 @@ import Cocoa
class KeyUtils {
static func isControlCode(key: String) -> Bool {
guard key.characters.count == 1 else {
return false
}
guard let firstChar = key.utf16.first else {
return false
}
return firstChar < 32 && firstChar > 0
}
static func isSpecial(key: String) -> Bool {
guard key.characters.count == 1 else {
return false

View File

@ -27,22 +27,18 @@ extension NeoVimView {
? event.charactersIgnoringModifiers!.lowercased()
: event.charactersIgnoringModifiers!
if KeyUtils.isSpecial(key: charsIgnoringModifiers) {
if let vimModifiers = self.vimModifierFlags(modifierFlags) {
self.agent.vimInput(
self.wrapNamedKeys(vimModifiers + KeyUtils.namedKeyFrom(key: charsIgnoringModifiers))
)
} else {
self.agent.vimInput(self.wrapNamedKeys(KeyUtils.namedKeyFrom(key: charsIgnoringModifiers)))
}
} else {
if let vimModifiers = self.vimModifierFlags(modifierFlags) {
self.agent.vimInput(self.wrapNamedKeys(vimModifiers + charsIgnoringModifiers))
} else {
self.agent.vimInput(self.vimPlainString(chars))
}
}
let flags = self.vimModifierFlags(modifierFlags) ?? ""
let isNamedKey = KeyUtils.isSpecial(key: charsIgnoringModifiers)
let isControlCode = KeyUtils.isControlCode(key: chars) && !isNamedKey
let isPlain = flags.isEmpty && !isNamedKey
let isWrapNeeded = !isControlCode && !isPlain
let namedChars = KeyUtils.namedKeyFrom(key: charsIgnoringModifiers)
let finalInput = isWrapNeeded
? self.wrapNamedKeys(flags + namedChars)
: self.vimPlainString(chars)
self.agent.vimInput(finalInput)
self.keyDownDone = true
}
@ -82,19 +78,44 @@ extension NeoVimView {
}
override public func performKeyEquivalent(with event: NSEvent) -> Bool {
let type = event.type
let flags = event.modifierFlags
if .keyDown != event.type { return false }
let flags = event.modifierFlags.intersection(.deviceIndependentFlagsMask)
/* <C-Tab> & <C-S-Tab> do not trigger keyDown events.
Catch the key event here and pass it to keyDown.
(By rogual in NeoVim dot app
https://github.com/rogual/neovim-dot-app/pull/248/files )
*/
if .keyDown == type && flags.contains(.control) && 48 == event.keyCode {
if flags.contains(.control) && 48 == event.keyCode {
self.keyDown(with: event)
return true
}
guard let chars = event.characters else {
return false;
}
// Control code \0 causes rpc parsing problems.
// So we escape as early as possible
if chars == "\0" {
self.agent.vimInput(self.wrapNamedKeys("Nul"))
return true
}
// For the following two conditions:
// See special cases in vim/os_win32.c from vim sources
// Also mentioned in MacVim's KeyBindings.plist
if .control == flags && chars == "6" {
self.agent.vimInput("\u{1e}") // AKA ^^
return true
}
if .control == flags && chars == "2" {
// <C-2> should generate \0, escaping as above
self.agent.vimInput(self.wrapNamedKeys("Nul"))
return true
}
// NsEvent already sets \u{1f} for <C--> && <C-_>
return false
}

View File

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

View File

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

View File

@ -1803,7 +1803,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 217;
DYLIB_CURRENT_VERSION = 218;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -1828,7 +1828,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 217;
DYLIB_CURRENT_VERSION = 218;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -2065,7 +2065,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 217;
CURRENT_PROJECT_VERSION = 218;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@ -2115,7 +2115,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 217;
CURRENT_PROJECT_VERSION = 218;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;

View File

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

View File

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

View File

@ -7,26 +7,22 @@
<description>Most recent changes with links to updates for VimR.</description>
<language>en</language>
<item>
<title>v0.18.0-217</title>
<title>SNAPSHOT-218</title>
<description><![CDATA[
<ul>
<li>GH-481: Bugfix: Quiting with <code>:qa!</code> warns about buffers that are already gone. (thanks @nhtzr for the PR)</li>
<li>GH-458: Drag &amp; Drop of files onto the main window works. (thanks @nhtzr for the PR)</li>
<li>GH-487: Hide the mouse cursor when typing. (thanks @nhtzr for the PR)</li>
<li>GH-315: Enable mapping of <code>&lt;C-Tab&gt;</code> and <code>&lt;C-S-Tab&gt;</code>. (thanks @nhtzr for the PR)</li>
<li>GH-368: Send <code>FocusGained</code> and <code>FocusLost</code> event to neovim backend. (thanks @nhtzr for the PR)</li>
<li>GH-492: Improve <code>Control</code> key handling: e.g. <code>Ctrl-6</code> works now. (thanks @nhtzr for the PR)</li>
</ul>
]]></description>
<releaseNotesLink>
https://github.com/qvacua/vimr/releases/tag/v0.18.0-217
https://github.com/qvacua/vimr/releases/tag/snapshot/218
</releaseNotesLink>
<pubDate>2017-08-13T07:46:01.861985</pubDate>
<pubDate>2017-08-16T17:50:59.561679</pubDate>
<minimumSystemVersion>10.10.0</minimumSystemVersion>
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.18.0-217/VimR-v0.18.0-217.tar.bz2"
sparkle:version="217"
sparkle:shortVersionString="0.18.0"
sparkle:dsaSignature="MC0CFQCxuuyXimvYXATNukOdPtHOE1TV/wIUL5MchH/pqdc/WnZaDekiaverBGA="
length="10703208"
<enclosure url="https://github.com/qvacua/vimr/releases/download/snapshot/218/VimR-SNAPSHOT-218.tar.bz2"
sparkle:version="218"
sparkle:shortVersionString="SNAPSHOT-218"
sparkle:dsaSignature="MC4CFQDe/hsRbcyet99lbrWnixj3UtYilwIVAIghLm6PmfF/jwnepWgzch3HwSPf"
length="10703484"
type="application/octet-stream"/>
</item>
</channel>

View File

@ -93,4 +93,13 @@ if [ "${UPDATE_APPCAST}" = true ] ; then
./bin/commit_and_push_appcast.sh "${BRANCH}" "${COMPOUND_VERSION}" ${IS_SNAPSHOT} ${UPDATE_SNAPSHOT_APPCAST_FOR_RELEASE}
fi
if [ "${IS_SNAPSHOT}" = false ] ; then
echo "### Merging ${BRANCH} back to develop"
git reset --hard @
git fetch origin
git checkout -b for_master_to_develop origin/develop
git merge --ff-only for_build
git push origin HEAD:develop
fi
echo "### Built VimR"

View File

@ -13,18 +13,13 @@ else
cp ./build/Release/appcast.xml .
fi
echo "### Commiting and pushing appcast to ${BRANCH}"
if [ "${IS_SNAPSHOT}" = false ] && [ "${UPDATE_SNAPSHOT_APPCAST_FOR_RELEASE}" = true ] ; then
cp appcast.xml appcast_snapshot.xml
fi
git commit -S -am "Bump appcast to ${COMPOUND_VERSION}"
echo "### Commiting and pushing appcast(s) to ${BRANCH}"
git add appcast*
git commit -S -m "Bump appcast(s) to ${COMPOUND_VERSION}"
git push origin HEAD:"${BRANCH}"
if [ "${IS_SNAPSHOT}" = false ] && [ "${UPDATE_SNAPSHOT_APPCAST_FOR_RELEASE}" = true ] ; then
echo "### Committing and pushing release appcast to develop"
git reset --hard @
git fetch origin
git checkout -b for_appcast origin/develop
git merge --ff-only for_build
cp appcast.xml appcast_snapshot.xml
git commit appcast_snapshot.xml -m "Update appcast_snapshot with version ${COMPOUND_VERSION}"
git push origin HEAD:develop
fi

View File

@ -1,5 +1,6 @@
# next
* GH-492: Improve `Control` key handling: e.g. `Ctrl-6` works now. (thanks @nhtzr for the PR)
* ...
# 0.18.0-217