From 641509fb701286ebd2c5c3a1bfc6ee6c3ca08007 Mon Sep 17 00:00:00 2001 From: Akin909 Date: Tue, 5 Jun 2018 18:39:14 +0100 Subject: [PATCH 1/6] pull upstream --- vim/core/typescript-vim | 2 +- vim/default/bundle/targets.vim | 2 +- vim/default/bundle/vim-commentary | 2 +- vim/default/bundle/vim-surround | 2 +- vim/default/bundle/vim-unimpaired | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vim/core/typescript-vim b/vim/core/typescript-vim index e25636b442..fbd0e9e508 160000 --- a/vim/core/typescript-vim +++ b/vim/core/typescript-vim @@ -1 +1 @@ -Subproject commit e25636b44211a4be7b089bfed7cf09aa7dd086f5 +Subproject commit fbd0e9e508535f7d89778f7280dc76505348dcc6 diff --git a/vim/default/bundle/targets.vim b/vim/default/bundle/targets.vim index c3042dc18a..dec6409fb8 160000 --- a/vim/default/bundle/targets.vim +++ b/vim/default/bundle/targets.vim @@ -1 +1 @@ -Subproject commit c3042dc18acc0dfcee479310d3efc6aefe92db75 +Subproject commit dec6409fb80ec1554bad582652f7511aa28c4ed2 diff --git a/vim/default/bundle/vim-commentary b/vim/default/bundle/vim-commentary index 7f2127b1df..89f43af186 160000 --- a/vim/default/bundle/vim-commentary +++ b/vim/default/bundle/vim-commentary @@ -1 +1 @@ -Subproject commit 7f2127b1dfc57811112785985b46ff2289d72334 +Subproject commit 89f43af18692d22ed999c3097e449f12fdd8b299 diff --git a/vim/default/bundle/vim-surround b/vim/default/bundle/vim-surround index 643a42454b..e49d6c2459 160000 --- a/vim/default/bundle/vim-surround +++ b/vim/default/bundle/vim-surround @@ -1 +1 @@ -Subproject commit 643a42454bc8c2b2735de14f309523ce733a5358 +Subproject commit e49d6c2459e0f5569ff2d533b4df995dd7f98313 diff --git a/vim/default/bundle/vim-unimpaired b/vim/default/bundle/vim-unimpaired index 4afeced83c..3a7759075c 160000 --- a/vim/default/bundle/vim-unimpaired +++ b/vim/default/bundle/vim-unimpaired @@ -1 +1 @@ -Subproject commit 4afeced83cb6bf32ba508fd57ad7dc45c96478f3 +Subproject commit 3a7759075cca5b0dc29ce81f2747489b6c8e36a7 From efdd77e05c03d751f50bbd871dc85dbf47de0f9d Mon Sep 17 00:00:00 2001 From: Akin909 Date: Mon, 18 Jun 2018 22:50:51 +0100 Subject: [PATCH 2/6] set user default to press and hold on ios --- main/src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/src/main.ts b/main/src/main.ts index 3b68a2404a..ce20c34625 100644 --- a/main/src/main.ts +++ b/main/src/main.ts @@ -1,7 +1,7 @@ import * as minimist from "minimist" import * as path from "path" -import { app, BrowserWindow, ipcMain, Menu } from "electron" +import { app, BrowserWindow, ipcMain, Menu, systemPreferences } from "electron" import * as PersistentSettings from "electron-settings" @@ -182,6 +182,10 @@ export function createWindow( width: windowState.bounds.width, }) + if (process.platform === "darwin") { + systemPreferences.setUserDefault("ApplePressAndHoldEnabled", "boolean", "true") + } + if (windowState.isMaximized) { currentWindow.maximize() } From 14961390dacebadfeca1e560e4a8924e586e07e6 Mon Sep 17 00:00:00 2001 From: Akin909 Date: Tue, 19 Jun 2018 00:01:11 +0100 Subject: [PATCH 3/6] add check to only set if not already set --- main/src/main.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/src/main.ts b/main/src/main.ts index ce20c34625..0943bce68b 100644 --- a/main/src/main.ts +++ b/main/src/main.ts @@ -183,7 +183,14 @@ export function createWindow( }) if (process.platform === "darwin") { - systemPreferences.setUserDefault("ApplePressAndHoldEnabled", "boolean", "true") + const pressAndHold: boolean = systemPreferences.getUserDefault( + "ApplePressAndHoldEnabled", + "boolean", + ) + + if (!pressAndHold) { + systemPreferences.setUserDefault("ApplePressAndHoldEnabled", "boolean", "true") + } } if (windowState.isMaximized) { From 3f290d377bc0ce845fd3360c8f7360942d3eef3b Mon Sep 17 00:00:00 2001 From: Akin909 Date: Tue, 19 Jun 2018 19:57:41 +0100 Subject: [PATCH 4/6] make minor change hopefully this picks up submodule changes --- main/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main.ts b/main/src/main.ts index 0943bce68b..86e5bdf0a9 100644 --- a/main/src/main.ts +++ b/main/src/main.ts @@ -182,7 +182,7 @@ export function createWindow( width: windowState.bounds.width, }) - if (process.platform === "darwin") { + if (process.platform.includes("darwin")) { const pressAndHold: boolean = systemPreferences.getUserDefault( "ApplePressAndHoldEnabled", "boolean", From 37f100f8a8090bb29cc165369c12fb14de9e85b7 Mon Sep 17 00:00:00 2001 From: Akin909 Date: Thu, 21 Jun 2018 08:02:41 +0100 Subject: [PATCH 5/6] move call to on app ready --- main/src/main.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/main/src/main.ts b/main/src/main.ts index af7816a191..346a880cbe 100644 --- a/main/src/main.ts +++ b/main/src/main.ts @@ -130,6 +130,10 @@ if (!isDevelopment && !isDebug && !isAutomation) { if (!isAutomation) { await addDevExtensions() } + + if (process.platform.includes("darwin")) { + ;(systemPreferences as any).setUserDefault("ApplePressAndHoldEnabled", "boolean", false) + } loadFileFromArguments(process.platform, argsToUse, process.env.ONI_CWD || process.cwd()) }) } @@ -182,17 +186,6 @@ export function createWindow( width: windowState.bounds.width, }) - if (process.platform.includes("darwin")) { - const pressAndHold: boolean = systemPreferences.getUserDefault( - "ApplePressAndHoldEnabled", - "boolean", - ) - - if (!pressAndHold) { - systemPreferences.setUserDefault("ApplePressAndHoldEnabled", "boolean", "true") - } - } - if (windowState.isMaximized) { currentWindow.maximize() } From 77dfe6775f3533223796a463ff2b9b4f297001ac Mon Sep 17 00:00:00 2001 From: Akin909 Date: Tue, 3 Jul 2018 00:02:56 +0100 Subject: [PATCH 6/6] fixed arguments and check --- main/src/main.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main/src/main.ts b/main/src/main.ts index 346a880cbe..05e081a166 100644 --- a/main/src/main.ts +++ b/main/src/main.ts @@ -132,7 +132,15 @@ if (!isDevelopment && !isDebug && !isAutomation) { } if (process.platform.includes("darwin")) { - ;(systemPreferences as any).setUserDefault("ApplePressAndHoldEnabled", "boolean", false) + const pressAndHold = systemPreferences.getUserDefault( + "ApplePressAndHoldEnabled", + "boolean", + ) + + if (pressAndHold) { + const untypedPrefs = systemPreferences as any + untypedPrefs.setUserDefault("ApplePressAndHoldEnabled", "boolean", false) + } } loadFileFromArguments(process.platform, argsToUse, process.env.ONI_CWD || process.cwd()) })