Skip to content

Commit

Permalink
Autocomplete-on-type by default on Mac (#2942)
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Jul 13, 2024
1 parent 2a91679 commit 6ad49e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frontend/common/KeyboardShortcuts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export let is_mac_keyboard = /Mac/.test(navigator.platform)
// @ts-ignore
export let is_mac_keyboard = /Mac/i.test(navigator.userAgentData.platform ?? navigator.platform)

export let control_name = is_mac_keyboard ? "⌃" : "Ctrl"
export let ctrl_or_cmd_name = is_mac_keyboard ? "⌘" : "Ctrl"
Expand Down
4 changes: 3 additions & 1 deletion frontend/components/CellInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ import { timeout_promise } from "../common/PlutoConnection.js"
import { LastFocusWasForcedEffect, tab_help_plugin } from "./CellInput/tab_help_plugin.js"
import { useEventListener } from "../common/useEventListener.js"
import { moveLineDown } from "../imports/CodemirrorPlutoSetup.js"
import { is_mac_keyboard } from "../common/KeyboardShortcuts.js"

export const ENABLE_CM_MIXED_PARSER = window.localStorage.getItem("ENABLE_CM_MIXED_PARSER") === "true"
export const ENABLE_CM_SPELLCHECK = window.localStorage.getItem("ENABLE_CM_SPELLCHECK") === "true"
export const ENABLE_CM_AUTOCOMPLETE_ON_TYPE = window.localStorage.getItem("ENABLE_CM_AUTOCOMPLETE_ON_TYPE") === "true"
export const ENABLE_CM_AUTOCOMPLETE_ON_TYPE =
(window.localStorage.getItem("ENABLE_CM_AUTOCOMPLETE_ON_TYPE") ?? (/Mac/.test(navigator.platform) ? "true" : "false")) === "true"

if (ENABLE_CM_MIXED_PARSER) {
console.log(`YOU ENABLED THE CODEMIRROR MIXED LANGUAGE PARSER
Expand Down

0 comments on commit 6ad49e5

Please sign in to comment.