-
Notifications
You must be signed in to change notification settings - Fork 298
Feature/set press and hold on macOS #2331
base: master
Are you sure you want to change the base?
Changes from 4 commits
641509f
8e8272a
efdd77e
1496139
3f290d3
3efbd65
bebd00c
37f100f
77dfe67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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,17 @@ export function createWindow( | |
width: windowState.bounds.width, | ||
}) | ||
|
||
if (process.platform === "darwin") { | ||
const pressAndHold: boolean = systemPreferences.getUserDefault( | ||
"ApplePressAndHoldEnabled", | ||
"boolean", | ||
) | ||
|
||
if (!pressAndHold) { | ||
systemPreferences.setUserDefault("ApplePressAndHoldEnabled", "boolean", "true") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, super cool! Didn't know we could do this. This will alleviate a common pain point on OSX. Nice find @Akin909 💯 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah that bit is quite confusing as the type for it from electron and the docs state the argument is a string got stuck on that for a while, seems like an issue for electron and their types for this function |
||
} | ||
} | ||
|
||
if (windowState.isMaximized) { | ||
currentWindow.maximize() | ||
} | ||
|
+40 −79 | README.md | |
+37 −89 | autoload/targets.vim | |
+84 −40 | plugin/targets.vim | |
+18 −18 | test/testM.ok | |
+18 −18 | test/testM.out |
+11 −9 | README.markdown | |
+23 −47 | doc/unimpaired.txt | |
+66 −111 | plugin/unimpaired.vim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
pressAndHold
(no!
), since ifApplePressAndHoldEnabled
is enabled, we want to disable it.