{"blobs":["/build/\n/.cloudflare/\n/.mygo/\nmygo_windows_*.syso\n/lime\n/cmd/lime/lime\noutput/\n","# AGENTS.md\n\nLime is a plain text editor modeled on Sublime Text (no packages), built on\nMyGo native UI (`ui`, `ui/editor`). Pure Go: everything builds with\n`CGO_ENABLED=0`.\n\nBefore changing UI code, read `.agents/skills/mygo-maintenance/SKILL.md`.\n`go tool mygo install-skills` manages it; don't edit it by hand.\n\n## Layout\n\nAll code is `package main` in `cmd/lime`. Keep it one package.\n\n- `app.go`: docs, groups, layouts, the `lime` and `app` types; open, save, close\n- `commands.go`: every command, by Sublime Text's command name\n- `keys.go`: default keys per platform; `keymap.go`: the user's key changes\n- `input.go`: the editor's mouse, remapped to Sublime Text's\n- `menu.go`: the menu bar; `contextmenu.go`: tab and side bar menus\n- `view.go` (window, tab bar, status bar), `sidebar.go`, `panel.go` (Goto\n  Anything, command palette), `find.go`, `tabdrag.go`, `preview.go`: window UI\n- `definition.go`: Goto Definition, from the definitions in the open tabs\n- `completion.go`: word completions, from the words of the open tabs\n- `jump.go`: Jump Back and Jump Forward, through where the caret jumped from\n- `indentation.go`: each file's own indentation, detected as it opens\n- `format.go`: a file's line endings; `encoding.go`: the encodings files\n  are read and saved in\n- `compare.go`: diff tabs, of a tab against a file, a tab, the clipboard or disk\n- `project.go`: folders, `.sublime-project` files, file operations\n- `recent.go`: Open Recent and Quick Switch Project, of the files, folders\n  and projects opened lately\n- `git.go`: the side bar's work tree and branch, switched from the quick panel\n- `remote.go`: Push, Pull and Fetch, and the side bar's counts of the commits\n  to push and to pull\n- `changes.go`: the side bar's Changes tab, of the work tree's changes, staged\n  or not; `history.go`: its History tab; `commitview.go`: a tab of the diffs\n  of a commit's files, or of the staged or unstaged changes; `avatar.go`:\n  commit authors' pictures, from GitHub\n- `gitmarks.go`: the side bar's files and folders, tinted as git status\n  has them, and dimmed where git ignores them\n- `minidiff.go`: what the gutter marks changes against: the file in git\n  (`git_diff_target`), or on disk if git doesn't track it\n- `blame.go`: who last changed the lines, at the end of the caret's line\n  (`inline_blame`) and in a column beside the gutter (Toggle Blame)\n- `permalink.go`: links to lines of files on GitHub, at HEAD's commit\n- `settings.go`, `settingsview.go`, `shortcutsview.go`: settings.json and its dialog\n- `session.go`: hot exit (session.json)\n- `theme.go`: color schemes and the chrome colors derived from them\n- `locales/`: `en.json` (source), `zh-Hans.json`; `catalog_gen.go` is generated\n- `website/`: the landing page, which runs Lime compiled to WebAssembly on a\n  few of this repository's files and their last commits, in memory; `git.js`\n  stands in for git (`git_js.go`). `mise run site:dev` builds and serves it\n\n## Terms\n\n- `lime`: process-wide state: settings, keymap, menu, windows\n- `app`: one window, not the application\n- `doc`: a tab. `group`: a pane of tabs. `place`: the focused group and doc\n- `settings` (`a.set`): persisted. `prefs`: the settings dialog's UI state\n\n## Rules\n\n- Sublime Text is the reference for behavior, command ids and per-platform keys.\n  When Lime’s established behavior differs from Sublime Text, explain what\n  the user would experience in each case, recommend one option and give the\n  reason, then ask which behavior to keep before changing it.\n- A new command touches `makeCommands`, its key in `appKeys` or the editor\n  keymaps, `shortcutGroups` (or the Shortcuts page won't list it), and\n  `newMenu` if it has a menu item.\n- Every user-visible string goes through `locales`: add the key to both JSON\n  files, then run `go tool mygo generate`. Never edit `catalog_gen.go`.\n- UI state changes only on the main thread. Run dialogs, folder walks and\n  decoding in a goroutine; publish results with `win.Update`.\n- settings.json and session.json must keep loading files from older versions.\n  Migrate in `settings.migrate` / `restoreSession`.\n- `input.go` calls MyGo's private editor input via `go:linkname` and a\n  reflected field offset. After a MyGo upgrade, run `TestSublimeInput` on macOS.\n\n## Verify\n\n```sh\ngo tool mygo vet .\ngo tool mygo i18n check .\nCGO_ENABLED=0 go test ./...\nmise run dev   # the app with live reload\n```\n\nTests drive the UI with `ui.NewTester(a.view, …)` on `newApp(\"\")`, which\nwrites no files.\n","module lime\n\ngo 1.27.4\n\ntool github.com/egoist/mygo/cmd/mygo\n\nrequire (\n\tgithub.com/ebitengine/purego v0.11.3\n\tgithub.com/egoist/mygo v0.10.0\n\tgolang.org/x/sys v0.50.0\n\tgolang.org/x/text v0.44.0\n)\n\nrequire (\n\tgithub.com/ProtonMail/go-crypto v1.5.2 // indirect\n\tgithub.com/cloudflare/circl v1.6.5 // indirect\n\tgithub.com/go-text/typesetting v0.3.5 // indirect\n\tgithub.com/klauspost/compress v1.20.4 // indirect\n\tgithub.com/ulikunitz/xz v0.5.17 // indirect\n\tgo.digitalxero.dev/rpm v0.3.4 // indirect\n\tgolang.org/x/crypto v0.59.0 // indirect\n\tgolang.org/x/image v0.48.0 // indirect\n\tgolang.org/x/net v0.63.0 // indirect\n)\n","[tools]\ngo = \"1.27.4\"\n\n[tasks.dev]\nrun = \"go tool mygo dev\"\n\n[tasks.\"build:darwin-arm64\"]\nrun = \"go tool mygo build -platform darwin/arm64\"\n\n[tasks.\"build:darwin-amd64\"]\nrun = \"go tool mygo build -platform darwin/amd64\"\n\n[tasks.\"build:windows-arm64\"]\nrun = \"go tool mygo build -platform windows/arm64\"\n\n[tasks.\"build:windows-amd64\"]\nrun = \"go tool mygo build -platform windows/amd64\"\n\n[tasks.\"build:linux-arm64\"]\nrun = \"go tool mygo build -platform linux/arm64\"\n\n[tasks.\"build:linux-amd64\"]\nrun = \"go tool mygo build -platform linux/amd64\"\n\n# One mygo invocation: parallel Windows builds would clash on the .syso\n# files mygo writes into cmd/lime.\n[tasks.\"build:all\"]\nrun = \"go tool mygo build -platform darwin/arm64,darwin/amd64,windows/arm64,windows/amd64,linux/arm64,linux/amd64\"\n\n[tasks.\"site:build\"]\nrun = \"go run website/build.go\"\n\n[tasks.\"site:dev\"]\ndepends = [\"site:build\"]\nrun = \"python3 -m http.server 5180 -d build/site\"\n\n[tasks.\"site:deploy\"]\ndepends = [\"site:build\"]\nrun = \"cf deploy build/site\"\n","{\n  \"name\": \"Lime\",\n  \"identifier\": \"me.xingkaixin.lime\",\n  \"version\": \"0.1.0\",\n  \"main\": \"./cmd/lime\",\n  \"out\": \"build\",\n  \"resources\": [\"cmd/lime/fileicons/LICENSE-pierre-icons.md\"],\n  \"i18n\": { \"dir\": \"locales\", \"source\": \"en\" },\n  \"updates\": {\n    \"publicKey\": \"ZEjKEsm/54wjyUcbbHClx+yhQ2rcUHrWZYYD/OXCgpk=\",\n    \"github\": \"xingkaixin/lime\"\n  },\n  \"macos\": {\n    \"infoPlist\": {\n      \"CFBundleDocumentTypes\": [\n        {\n          \"CFBundleTypeName\": \"Document\",\n          \"CFBundleTypeRole\": \"Editor\",\n          \"LSHandlerRank\": \"Alternate\",\n          \"LSItemContentTypes\": [\"public.text\", \"public.data\", \"public.folder\"]\n        }\n      ]\n    }\n  }\n}\n","{\n  \"@@locale\": \"en\",\n\n  \"untitled\": \"untitled\",\n  \"light\": \"Light\",\n  \"dark\": \"Dark\",\n  \"plainText\": \"Plain Text\",\n  \"buttonSave\": \"Save\",\n  \"buttonDontSave\": \"Don't Save\",\n  \"buttonCancel\": \"Cancel\",\n  \"buttonDelete\": \"Delete\",\n  \"buttonReplace\": \"Replace\",\n  \"buttonKeepBoth\": \"Keep Both\",\n  \"buttonDiscard\": \"Discard\",\n  \"buttonRevert\": \"Revert\",\n  \"buttonUncommit\": \"Uncommit\",\n  \"buttonOverwrite\": \"Overwrite\",\n  \"buttonReload\": \"Reload\",\n\n  \"menuFile\": \"File\",\n  \"menuNewFile\": \"New File\",\n  \"menuNewWindow\": \"New Window\",\n  \"menuOpen\": \"Open…\",\n  \"menuOpenFolder\": \"Open Folder…\",\n  \"menuOpenRecent\": \"Open Recent\",\n  \"menuReopenClosedFile\": \"Reopen Closed File\",\n  \"menuClearItems\": \"Clear Items\",\n  \"menuReopenWithEncoding\": \"Reopen with Encoding\",\n  \"menuRevertFile\": \"Revert File\",\n  \"menuSaveWithEncoding\": \"Save with Encoding\",\n  \"menuSave\": \"Save\",\n  \"menuSaveAs\": \"Save As…\",\n  \"menuSaveAll\": \"Save All\",\n  \"menuCloseFile\": \"Close File\",\n  \"menuCloseWindow\": \"Close Window\",\n  \"menuConvertCase\": \"Convert Case\",\n  \"menuTitleCase\": \"Title Case\",\n  \"menuUpperCase\": \"Upper Case\",\n  \"menuLowerCase\": \"Lower Case\",\n  \"menuSwapCase\": \"Swap Case\",\n  \"menuSnakeCase\": \"Snake Case\",\n  \"menuKebabCase\": \"Kebab Case\",\n  \"menuCamelCase\": \"Camel Case\",\n  \"menuPascalCase\": \"Pascal Case\",\n  \"menuSpeech\": \"Speech\",\n  \"menuFind\": \"Find\",\n  \"menuFindEllipsis\": \"Find…\",\n  \"menuFindNext\": \"Find Next\",\n  \"menuFindPrevious\": \"Find Previous\",\n  \"menuReplace\": \"Replace…\",\n  \"menuQuickFindAll\": \"Quick Find All\",\n  \"menuQuickAddNext\": \"Quick Add Next\",\n  \"menuQuickSkipNext\": \"Quick Skip Next\",\n  \"menuUseSelectionForFind\": \"Use Selection for Find\",\n  \"menuFindInFiles\": \"Find in Files…\",\n  \"menuView\": \"View\",\n  \"menuSideBar\": \"Side Bar\",\n  \"menuLayout\": \"Layout\",\n  \"menuGroups\": \"Groups\",\n  \"menuNewGroup\": \"New Group\",\n  \"menuCloseGroup\": \"Close Group\",\n  \"menuColorScheme\": \"Color Scheme\",\n  \"menuSyntax\": \"Syntax…\",\n  \"menuIndentation\": \"Indentation\",\n  \"menuIndentUsingSpaces\": \"Indent Using Spaces\",\n  \"menuTabWidth\": \"Tab Width: {width}\",\n  \"@menuTabWidth\": {\n    \"placeholders\": { \"width\": { \"type\": \"int\", \"example\": \"4\" } }\n  },\n  \"menuGuessIndentation\": \"Guess Settings From Buffer\",\n  \"menuConvertToSpaces\": \"Convert Indentation to Spaces\",\n  \"menuConvertToTabs\": \"Convert Indentation to Tabs\",\n  \"menuLineEndings\": \"Line Endings\",\n  \"menuWindows\": \"Windows\",\n  \"menuUnix\": \"Unix\",\n  \"menuMacOS9\": \"Mac OS 9\",\n  \"encodingWindows1252\": \"Western (Windows 1252)\",\n  \"encodingISO88591\": \"Western (ISO 8859-1)\",\n  \"menuWordWrap\": \"Word Wrap\",\n  \"menuRampageMode\": \"Rampage Mode\",\n  \"menuLargerFont\": \"Larger Font\",\n  \"menuSmallerFont\": \"Smaller Font\",\n  \"menuResetFontSize\": \"Reset Font Size\",\n  \"menuGoto\": \"Goto\",\n  \"menuGotoAnything\": \"Goto Anything…\",\n  \"menuGotoSymbol\": \"Goto Symbol…\",\n  \"menuGotoLine\": \"Goto Line…\",\n  \"menuCommandPalette\": \"Command Palette…\",\n  \"menuNextModification\": \"Next Modification\",\n  \"menuPreviousModification\": \"Previous Modification\",\n  \"menuProject\": \"Project\",\n  \"menuOpenProject\": \"Open Project…\",\n  \"menuQuickSwitchProject\": \"Quick Switch Project…\",\n  \"menuSaveProjectAs\": \"Save Project As…\",\n  \"menuCloseProject\": \"Close Project\",\n  \"menuAddFolderToProject\": \"Add Folder to Project…\",\n  \"menuRefreshFolders\": \"Refresh Folders\",\n  \"menuRename\": \"Rename…\",\n  \"menuDeleteFile\": \"Delete File\",\n  \"menuRevealInFinder\": \"Reveal in Finder\",\n  \"menuRevealInSideBar\": \"Reveal in Side Bar\",\n  \"menuCopyPath\": \"Copy Path\",\n  \"menuFileHistory\": \"File History\",\n  \"menuCopyPermalink\": \"Copy Permalink\",\n  \"menuOpenOnGitHub\": \"Open on GitHub\",\n  \"menuNewFolder\": \"New Folder…\",\n  \"menuDeleteFolder\": \"Delete Folder\",\n  \"menuFindInFolder\": \"Find in Folder…\",\n  \"menuRemoveFolder\": \"Remove Folder from Project\",\n  \"menuCloseTab\": \"Close Tab\",\n  \"menuCloseOtherTabs\": \"Close Other Tabs\",\n  \"menuCloseTabsToLeft\": \"Close Tabs to the Left\",\n  \"menuCloseTabsToRight\": \"Close Tabs to the Right\",\n  \"menuCloseUnmodifiedTabs\": \"Close Unmodified Tabs\",\n  \"menuCloseDeletedTabs\": \"Close Tabs With Deleted Files\",\n  \"menuOpenFile\": \"Open File…\",\n  \"menuOpenPreview\": \"Open Preview\",\n  \"menuOpenPreviewToTheSide\": \"Open Preview to the Side\",\n\n  \"layoutSingle\": \"Single\",\n  \"layoutColumns2\": \"Columns: 2\",\n  \"layoutColumns3\": \"Columns: 3\",\n  \"layoutColumns4\": \"Columns: 4\",\n  \"layoutGrid4\": \"Grid: 4\",\n  \"layoutRows2\": \"Rows: 2\",\n  \"layoutRows3\": \"Rows: 3\",\n  \"layoutCompact\": \"Compact\",\n  \"layoutComfortable\": \"Comfortable\",\n  \"cursorBar\": \"Bar\",\n  \"cursorBlock\": \"Block\",\n  \"cursorUnderline\": \"Underline\",\n  \"cursorGlow\": \"Glow\",\n  \"cursorSpark\": \"Spark\",\n  \"cursorSmooth\": \"Smooth\",\n  \"typingNormal\": \"Normal\",\n  \"typingRampage\": \"Rampage\",\n  \"fileIconsDefault\": \"File Icons\",\n  \"fileIconsPierre\": \"Pierre\",\n\n  \"cmdNewFile\": \"File: New File\",\n  \"cmdOpen\": \"File: Open…\",\n  \"cmdOpenFolder\": \"File: Open Folder…\",\n  \"cmdReopenClosedFile\": \"File: Reopen Closed File\",\n  \"cmdSave\": \"File: Save\",\n  \"cmdSaveAs\": \"File: Save As…\",\n  \"cmdSaveAll\": \"File: Save All\",\n  \"cmdRevertFile\": \"File: Revert File\",\n  \"cmdClose\": \"File: Close\",\n  \"cmdCloseOtherTabs\": \"File: Close Other Tabs\",\n  \"cmdCopyPath\": \"File: Copy Path\",\n  \"cmdRevealInSideBar\": \"Reveal in Side Bar\",\n  \"cmdRevealInFinder\": \"Reveal in Finder\",\n  \"cmdNewWindow\": \"Window: New Window\",\n  \"cmdCloseWindow\": \"Window: Close\",\n  \"cmdGotoAnything\": \"Goto Anything\",\n  \"cmdGotoLine\": \"Goto Line\",\n  \"cmdGotoSymbol\": \"Goto Symbol\",\n  \"cmdJumpBack\": \"Jump Back\",\n  \"cmdJumpForward\": \"Jump Forward\",\n  \"cmdToggleSideBar\": \"View: Toggle Side Bar\",\n  \"cmdToggleFilesPanel\": \"View: Toggle Files Panel\",\n  \"cmdToggleGitPanel\": \"View: Toggle Git Panel\",\n  \"cmdToggleWordWrap\": \"Word Wrap: Toggle\",\n  \"cmdToggleRampageMode\": \"Rampage Mode: Toggle\",\n  \"cmdIncreaseFontSize\": \"Font: Increase\",\n  \"cmdDecreaseFontSize\": \"Font: Decrease\",\n  \"cmdResetFontSize\": \"Font: Reset\",\n  \"cmdSelectColorScheme\": \"UI: Select Color Scheme\",\n  \"cmdSetSyntax\": \"Set Syntax…\",\n  \"cmdNewPane\": \"Layout: New Pane\",\n  \"cmdClosePane\": \"Layout: Close Pane\",\n  \"cmdAddFolder\": \"Project: Add Folder…\",\n  \"cmdOpenProject\": \"Project: Open Project…\",\n  \"cmdQuickSwitchProject\": \"Project: Quick Switch Project…\",\n  \"cmdSaveProjectAs\": \"Project: Save As…\",\n  \"cmdCloseProject\": \"Project: Close Project\",\n  \"cmdRefreshFolders\": \"Project: Refresh Folders\",\n  \"cmdFileHistory\": \"Git: File History\",\n  \"cmdToggleBlame\": \"Git: Toggle Blame\",\n  \"cmdToggleInlineBlame\": \"Git: Toggle Inline Blame\",\n  \"cmdCopyPermalink\": \"Git: Copy Permalink\",\n  \"cmdOpenOnGitHub\": \"Git: Open on GitHub\",\n  \"cmdUpperCase\": \"Convert Case: Upper Case\",\n  \"cmdLowerCase\": \"Convert Case: Lower Case\",\n  \"cmdTitleCase\": \"Convert Case: Title Case\",\n  \"cmdSwapCase\": \"Convert Case: Swap Case\",\n  \"cmdSnakeCase\": \"Convert Case: Snake Case\",\n  \"cmdKebabCase\": \"Convert Case: Kebab Case\",\n  \"cmdCamelCase\": \"Convert Case: Camel Case\",\n  \"cmdPascalCase\": \"Convert Case: Pascal Case\",\n  \"cmdSortLines\": \"Sort Lines\",\n  \"cmdSortLinesCaseSensitive\": \"Sort Lines (Case Sensitive)\",\n  \"cmdReverseLines\": \"Permute Lines: Reverse\",\n  \"cmdUniqueLines\": \"Permute Lines: Unique\",\n  \"cmdDeleteBlankLines\": \"Delete Blank Lines\",\n  \"cmdDeleteSurplusBlankLines\": \"Delete Surplus Blank Lines\",\n  \"cmdFormatJSON\": \"JSON: Format\",\n  \"cmdMinifyJSON\": \"JSON: Minify\",\n  \"cmdCompareWith\": \"Compare: With File or Tab…\",\n  \"cmdCompareWithClipboard\": \"Compare: With Clipboard\",\n  \"cmdShowUnsavedChanges\": \"Compare: Show Unsaved Changes\",\n  \"cmdOpenPreview\": \"Markdown: Open Preview\",\n  \"cmdOpenPreviewToTheSide\": \"Markdown: Open Preview to the Side\",\n  \"cmdToggleComment\": \"Toggle Comment\",\n  \"cmdToggleBlockComment\": \"Toggle Block Comment\",\n  \"cmdSplitSelection\": \"Selection: Split into Lines\",\n  \"cmdJoinLines\": \"Join Lines\",\n  \"cmdDuplicateLine\": \"Duplicate Line\",\n  \"cmdDeleteLine\": \"Delete Line\",\n  \"cmdSwapLineUp\": \"Swap Line Up\",\n  \"cmdSwapLineDown\": \"Swap Line Down\",\n  \"cmdTrimTrailingWhiteSpace\": \"Trim Trailing White Space\",\n  \"cmdFoldAll\": \"Code Folding: Fold All\",\n  \"cmdUnfoldAll\": \"Code Folding: Unfold All\",\n  \"cmdNextModification\": \"Goto Next Modification\",\n  \"cmdPreviousModification\": \"Goto Previous Modification\",\n  \"cmdRevertHunk\": \"Revert Diff Hunk\",\n  \"cmdLayout\": \"Layout: {name}\",\n  \"cmdCursorStyle\": \"Cursor Style: {name}\",\n  \"cmdFileIcons\": \"File Icons: {name}\",\n  \"@cmdFileIcons\": {\n    \"description\": \"A file icon set in the command palette.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"Pierre\" } }\n  },\n  \"@cmdLayout\": {\n    \"description\": \"A layout in the command palette.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"Columns: 2\" } }\n  },\n  \"cmdSetSyntaxTo\": \"Set Syntax: {name}\",\n  \"@cmdSetSyntaxTo\": {\n    \"description\": \"A syntax in the command palette.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"Markdown\" } }\n  },\n  \"cmdIndentUsingSpaces\": \"Indent Using Spaces: Toggle\",\n  \"cmdTabWidth\": \"Indentation: Tab Width {width}\",\n  \"@cmdTabWidth\": {\n    \"placeholders\": { \"width\": { \"type\": \"int\", \"example\": \"4\" } }\n  },\n  \"cmdGuessIndentation\": \"Indentation: Guess Settings From Buffer\",\n  \"cmdConvertToSpaces\": \"Indentation: Convert to Spaces\",\n  \"cmdConvertToTabs\": \"Indentation: Convert to Tabs\",\n  \"cmdLineEndings\": \"Line Endings: {name}\",\n  \"@cmdLineEndings\": {\n    \"description\": \"A line ending in the command palette, and the status bar's line ending button to assistive technology.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"Unix\" } }\n  },\n  \"cmdReopenWithEncoding\": \"Reopen with Encoding: {name}\",\n  \"@cmdReopenWithEncoding\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"GBK\" } }\n  },\n  \"cmdSaveWithEncoding\": \"Save with Encoding: {name}\",\n  \"@cmdSaveWithEncoding\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"GBK\" } }\n  },\n  \"cmdCreateBranch\": \"Git: Create Branch…\",\n  \"cmdDeleteBranch\": \"Git: Delete Branch…\",\n  \"cmdRenameBranch\": \"Git: Rename Branch…\",\n  \"cmdUncommit\": \"Git: Uncommit\",\n  \"cmdPush\": \"Git: Push\",\n  \"cmdPull\": \"Git: Pull\",\n  \"cmdFetch\": \"Git: Fetch\",\n\n  \"panelLabel\": \"Quick panel\",\n  \"panelCommandPalette\": \"Command Palette\",\n  \"panelSelectColorScheme\": \"Select Color Scheme\",\n  \"panelSetSyntax\": \"Set Syntax\",\n  \"panelNoMatches\": \"No matches\",\n  \"panelTypeLine\": \"Type a line number to go to\",\n  \"panelGoToLine\": \"Go to line {line, number, ::group-off}\",\n  \"@panelGoToLine\": {\n    \"placeholders\": { \"line\": { \"type\": \"int\", \"example\": \"42\" } }\n  },\n  \"panelCompareWith\": \"Choose a file to compare with {name}\",\n  \"@panelCompareWith\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"panelBrowseFiles\": \"Browse Other Files…\",\n  \"panelBrowseFilesDetail\": \"Choose a file outside the project with the system dialog\",\n  \"panelOpenTab\": \"Open\",\n  \"@panelOpenTab\": {\n    \"description\": \"Marks a file of the list that is open in a tab.\"\n  },\n  \"promptNewName\": \"New Name:\",\n  \"promptBranchName\": \"Branch Name:\",\n\n  \"dialogUnableToOpen\": \"Unable to open {name}\",\n  \"@dialogUnableToOpen\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogSavedAsUTF8\": \"Saved {name} as UTF-8\",\n  \"@dialogSavedAsUTF8\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogNotRepresentable\": \"Not all characters are representable in {encoding}.\",\n  \"@dialogNotRepresentable\": {\n    \"placeholders\": { \"encoding\": { \"type\": \"String\", \"example\": \"GBK\" } }\n  },\n  \"dialogUnableToSave\": \"Unable to save {name}\",\n  \"@dialogUnableToSave\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogUnableToRename\": \"Unable to rename {name}\",\n  \"@dialogUnableToRename\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogUnableToMove\": \"Unable to move {name}\",\n  \"@dialogUnableToMove\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogUnableToCopy\": \"Unable to copy {name}\",\n  \"@dialogUnableToCopy\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogUnableToCreate\": \"Unable to create {name}\",\n  \"@dialogUnableToCreate\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"src\" } }\n  },\n  \"dialogUnableToDelete\": \"Unable to delete {name}\",\n  \"@dialogUnableToDelete\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogUnableToKeepFiles\": \"Unable to keep the open files\",\n  \"dialogUnableToReadSettings\": \"Unable to read settings.json\",\n  \"dialogUnableToOpenProject\": \"Unable to open the project\",\n  \"dialogUnableToSaveProject\": \"Unable to save the project\",\n  \"dialogSaveChanges\": \"Save changes to {name} before closing?\",\n  \"@dialogSaveChanges\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogRevertFile\": \"Revert {name} to the version on disk?\",\n  \"@dialogRevertFile\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogSaveWindowChanges\": \"{count, plural, one {Save changes to # file before closing the window?} other {Save changes to # files before closing the window?}}\",\n  \"@dialogSaveWindowChanges\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"dialogChangedOnDisk\": \"{name} has changed on disk.\",\n  \"@dialogChangedOnDisk\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogChangedOnDiskDetail\": \"Saving overwrites the changes on disk.\",\n  \"dialogDelete\": \"Delete {name}?\",\n  \"@dialogDelete\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"src\" } }\n  },\n  \"dialogDeleteFolder\": \"The folder and what it holds move to the Trash.\",\n  \"dialogUnsavedLost\": \"Unsaved changes are lost.\",\n  \"dialogItemExists\": \"An item named {name} already exists in {folder}.\",\n  \"@dialogItemExists\": {\n    \"placeholders\": {\n      \"name\": { \"type\": \"String\", \"example\": \"main.go\" },\n      \"folder\": { \"type\": \"String\", \"example\": \"src\" }\n    }\n  },\n  \"dialogReplaceDetail\": \"Replacing it moves the one there to the Trash.\",\n  \"dialogDiscardFiles\": \"{count, plural, one {Discard the changes to # file?} other {Discard the changes to # files?}}\",\n  \"@dialogDiscardFiles\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"dialogDiscardHunk\": \"Discard this hunk of {name}?\",\n  \"@dialogDiscardHunk\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"dialogDiscardLost\": \"Changes that aren't staged can't be recovered.\",\n  \"dialogDiscardUntracked\": \"New files move to the Trash.\",\n  \"dialogBranchNotMerged\": \"{name} is not fully merged. Delete it anyway?\",\n  \"@dialogBranchNotMerged\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"topic\" } }\n  },\n  \"dialogBranchCommitsLost\": \"The commits only it has are lost.\",\n  \"dialogUncommit\": \"Uncommit “{subject}”?\",\n  \"@dialogUncommit\": {\n    \"placeholders\": { \"subject\": { \"type\": \"String\", \"example\": \"Fix the build\" } }\n  },\n  \"dialogUncommitDetail\": \"Its changes go back to the staged changes.\",\n  \"dialogAmendPushed\": \"Amend a commit that is already pushed?\",\n  \"dialogPushedDetail\": \"The branch will then diverge from its upstream, and Lime has no force push.\",\n  \"dialogGitFailed\": \"{command} failed\",\n  \"@dialogGitFailed\": {\n    \"placeholders\": { \"command\": { \"type\": \"String\", \"example\": \"git push\" } }\n  },\n  \"filterProject\": \"Sublime Project\",\n\n  \"sideBarDropFolder\": \"Drop a folder here to open it\",\n  \"sideBarFilesPanel\": \"Files Panel\",\n  \"sideBarGitPanel\": \"Git Panel\",\n  \"sideBarNoRepository\": \"No Git Repository\",\n  \"gitChanges\": \"Changes\",\n  \"gitHistory\": \"History\",\n  \"historyAllCommits\": \"Show All Commits\",\n  \"blameNotCommitted\": \"Not Committed Yet\",\n  \"statusPermalinkCopied\": \"Copied the permalink\",\n  \"statusNoGitHub\": \"No remote of this repository is on GitHub\",\n  \"statusPermalinkChanged\": \"The file differs from HEAD's: the permalink's lines may be others\",\n  \"statusNotPushed\": \"HEAD isn't pushed yet: the permalink opens nothing until it is\",\n  \"changesConflicts\": \"Conflicts\",\n  \"changesStaged\": \"Staged\",\n  \"changesUnstaged\": \"Unstaged\",\n  \"changesNone\": \"No Changes\",\n  \"changesStage\": \"Stage\",\n  \"changesUnstage\": \"Unstage\",\n  \"changesStageAll\": \"Stage All\",\n  \"changesUnstageAll\": \"Unstage All\",\n  \"changesViewAsTree\": \"View as Tree\",\n  \"changesMessage\": \"Commit Message\",\n  \"changesCommit\": \"Commit\",\n  \"changesCommitTracked\": \"Commit Tracked\",\n  \"changesStagedTitle\": \"Staged Changes\",\n  \"changesUnstagedTitle\": \"Unstaged Changes\",\n  \"changesDiscard\": \"Discard Changes\",\n  \"changesAmend\": \"Amend\",\n  \"timeJustNow\": \"Just now\",\n  \"timeMinutesAgo\": \"{count, plural, one {# minute ago} other {# minutes ago}}\",\n  \"@timeMinutesAgo\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"timeHoursAgo\": \"{count, plural, one {# hour ago} other {# hours ago}}\",\n  \"@timeHoursAgo\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"timeDaysAgo\": \"{count, plural, one {# day ago} other {# days ago}}\",\n  \"@timeDaysAgo\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"timeWeeksAgo\": \"{count, plural, one {# week ago} other {# weeks ago}}\",\n  \"@timeWeeksAgo\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"timeMonthsAgo\": \"{count, plural, one {# month ago} other {# months ago}}\",\n  \"@timeMonthsAgo\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"timeYearsAgo\": \"{count, plural, one {# year ago} other {# years ago}}\",\n  \"@timeYearsAgo\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"commitCollapseAll\": \"Collapse All\",\n  \"commitExpandAll\": \"Expand All\",\n  \"commitCopySHA\": \"Copy SHA\",\n  \"commitShowMessage\": \"Show Full Message\",\n  \"commitHideMessage\": \"Hide Full Message\",\n  \"commitCopied\": \"Copied {hash}\",\n  \"@commitCopied\": {\n    \"placeholders\": { \"hash\": { \"type\": \"String\", \"example\": \"55a00dc\" } }\n  },\n  \"commitUnchangedLines\": \"{count, plural, one {# unchanged line} other {# unchanged lines}}\",\n  \"@commitUnchangedLines\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"12\" } }\n  },\n  \"gitSwitchBranch\": \"Switch Branch\",\n  \"gitSwitchWorktree\": \"Switch Worktree\",\n  \"gitBranchPlaceholder\": \"Switch Branch or Apply Stash\",\n  \"gitCurrent\": \"Current\",\n  \"gitRemoteBranch\": \"Remote branch\",\n  \"gitStash\": \"Stash\",\n  \"gitDeleteBranch\": \"Delete Branch\",\n  \"previewBinary\": \"This file is binary and can't be shown.\",\n  \"tabBar\": \"Tab bar\",\n  \"tabScrollLeft\": \"Scroll Tabs Left\",\n  \"tabScrollRight\": \"Scroll Tabs Right\",\n  \"tabList\": \"Open Tabs\",\n  \"tabSwitcher\": \"Switch Tab\",\n  \"tabClose\": \"Close {name}\",\n  \"@tabClose\": {\n    \"description\": \"The button closing a tab, to assistive technology.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"tabUnsavedChanges\": \"{name}: Unsaved Changes\",\n  \"@tabUnsavedChanges\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"tabPreview\": \"Preview: {name}\",\n  \"@tabPreview\": {\n    \"description\": \"The title of a Markdown preview's tab.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"README.md\" } }\n  },\n  \"compareClipboard\": \"Clipboard\",\n  \"compareOnDisk\": \"{name} on Disk\",\n  \"@compareOnDisk\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"compareEdited\": \"{name} in Editor\",\n  \"@compareEdited\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"main.go\" } }\n  },\n  \"compareEditable\": \"Editable\",\n  \"compareRevert\": \"Revert\",\n  \"compareSideBySide\": \"Side by Side\",\n  \"compareUnified\": \"Unified\",\n  \"statusSideBar\": \"Show or Hide Side Bar\",\n  \"statusSelections\": \"{count, plural, one {# selection region} other {# selection regions}}\",\n  \"@statusSelections\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"statusPosition\": \"Line {line, number, ::group-off}, Column {column, number, ::group-off}\",\n  \"@statusPosition\": {\n    \"placeholders\": {\n      \"line\": { \"type\": \"int\", \"example\": \"12\" },\n      \"column\": { \"type\": \"int\", \"example\": \"5\" }\n    }\n  },\n  \"statusSelectedChars\": \"{count, plural, one {# character selected} other {# characters selected}}\",\n  \"@statusSelectedChars\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"5\" } }\n  },\n  \"statusSelectedLines\": \"{lines, plural, one {# line} other {# lines}}, {chars, plural, one {# character} other {# characters}} selected\",\n  \"@statusSelectedLines\": {\n    \"placeholders\": {\n      \"lines\": { \"type\": \"int\", \"example\": \"3\" },\n      \"chars\": { \"type\": \"int\", \"example\": \"25\" }\n    }\n  },\n  \"statusSyntax\": \"Syntax: {name}\",\n  \"@statusSyntax\": {\n    \"description\": \"The status bar's syntax button, to assistive technology.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"Go\" } }\n  },\n  \"statusSpaces\": \"Spaces: {size}\",\n  \"@statusSpaces\": {\n    \"placeholders\": { \"size\": { \"type\": \"int\", \"example\": \"4\" } }\n  },\n  \"statusTabSize\": \"Tab Size: {size}\",\n  \"@statusTabSize\": {\n    \"placeholders\": { \"size\": { \"type\": \"int\", \"example\": \"4\" } }\n  },\n  \"statusEncoding\": \"Encoding: {name}\",\n  \"@statusEncoding\": {\n    \"description\": \"The status bar's encoding button, to assistive technology.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"UTF-8\" } }\n  },\n  \"statusReopenUnsaved\": \"Save the changes before reopening the file\",\n  \"statusNotInEncoding\": \"Not reopened: the file has bytes that aren't {encoding}\",\n  \"@statusNotInEncoding\": {\n    \"placeholders\": { \"encoding\": { \"type\": \"String\", \"example\": \"GBK\" } }\n  },\n  \"statusInvalidJSON\": \"Invalid JSON: unexpected character “{char}”\",\n  \"@statusInvalidJSON\": {\n    \"placeholders\": { \"char\": { \"type\": \"String\", \"example\": \"}\" } }\n  },\n  \"statusIncompleteJSON\": \"Invalid JSON: unexpected end of input\",\n  \"statusNoParentCommit\": \"HEAD has no parent commit to go back to\",\n  \"statusUncommitMerge\": \"A merge commit can't be uncommitted\",\n  \"statusPushing\": \"Pushing…\",\n  \"statusPulling\": \"Pulling…\",\n  \"statusFetching\": \"Fetching…\",\n  \"statusNoDefinition\": \"No definition of “{name}”\",\n  \"@statusNoDefinition\": {\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"newDoc\" } }\n  },\n  \"statusNoDifferences\": \"No differences\",\n  \"statusDifferences\": \"{count, plural, one {# difference} other {# differences}}\",\n  \"@statusDifferences\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"5\" } }\n  },\n  \"statusChanges\": \"{count, plural, one {# change} other {# changes}}\",\n  \"@statusChanges\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"2\" } }\n  },\n  \"statusDiffLayout\": \"Diff layout: {name}\",\n  \"@statusDiffLayout\": {\n    \"description\": \"The status bar's button choosing how a comparison shows, to assistive technology.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"Side by Side\" } }\n  },\n\n  \"findRegex\": \"Regular expression\",\n  \"findCaseSensitive\": \"Case sensitive\",\n  \"findWholeWord\": \"Whole word\",\n  \"findInSelection\": \"In selection\",\n  \"find\": \"Find\",\n  \"findPrevious\": \"Find Prev\",\n  \"findAll\": \"Find All\",\n  \"replace\": \"Replace\",\n  \"replaceAll\": \"Replace All\",\n  \"findWhere\": \"Where\",\n  \"findSearching\": \"Searching…\",\n  \"findResults\": \"Find Results\",\n  \"findResultsSearching\": \"Searching for “{query}”…\",\n  \"@findResultsSearching\": {\n    \"placeholders\": { \"query\": { \"type\": \"String\", \"example\": \"main\" } }\n  },\n  \"findResultsHeader\": \"Searching {count, plural, one {# file} other {# files}} for “{query}”\",\n  \"@findResultsHeader\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"12\" }, \"query\": { \"type\": \"String\", \"example\": \"main\" } }\n  },\n  \"findResultsSummary\": \"{matches, plural, one {# match} other {# matches}} {files, plural, one {in # file} other {across # files}}\",\n  \"@findResultsSummary\": {\n    \"placeholders\": { \"matches\": { \"type\": \"int\", \"example\": \"5\" }, \"files\": { \"type\": \"int\", \"example\": \"2\" } }\n  },\n  \"findResultsLimit\": \"Stopped at {count} matches\",\n  \"@findResultsLimit\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"10000\" } }\n  },\n  \"statusInvalidRegex\": \"Invalid regular expression\",\n  \"statusReplacedInFiles\": \"{count, plural, one {Replaced # occurrence} other {Replaced # occurrences}} {files, plural, one {in # file} other {across # files}}\",\n  \"@statusReplacedInFiles\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"5\" }, \"files\": { \"type\": \"int\", \"example\": \"2\" } }\n  },\n  \"dialogReplaceInFiles\": \"{count, plural, one {Replace # occurrence} other {Replace # occurrences}} {files, plural, one {in # file?} other {across # files?}}\",\n  \"@dialogReplaceInFiles\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"5\" }, \"files\": { \"type\": \"int\", \"example\": \"2\" } }\n  },\n\n  \"menuSettings\": \"Settings…\",\n  \"cmdSettings\": \"Preferences: Settings\",\n  \"settingsTitle\": \"Settings\",\n  \"settingsGeneral\": \"General\",\n  \"settingsAppearance\": \"Appearance\",\n  \"settingsFonts\": \"Fonts\",\n  \"settingsEditor\": \"Editor\",\n  \"settingsDisplay\": \"Display\",\n  \"settingsRulers\": \"Rulers\",\n  \"settingsWhiteSpace\": \"White Space\",\n  \"settingsWhiteSpaceNone\": \"None\",\n  \"settingsWhiteSpaceSelection\": \"In Selection\",\n  \"settingsWhiteSpaceTrailing\": \"Trailing\",\n  \"settingsWhiteSpaceAll\": \"All\",\n  \"settingsLineNumbers\": \"Line Numbers\",\n  \"settingsHighlightLine\": \"Highlight Current Line\",\n  \"settingsIndentGuides\": \"Indent Guides\",\n  \"settingsScrollPastEnd\": \"Scroll Past End\",\n  \"settingsScrollBars\": \"Scroll Bars\",\n  \"settingsCursorStyle\": \"Cursor Style\",\n  \"settingsAutoComplete\": \"Auto Complete\",\n  \"settingsTypingMode\": \"Typing Mode\",\n  \"settingsInlineBlame\": \"Inline Blame\",\n  \"settingsGitDiffTarget\": \"Diff Target\",\n  \"settingsGitDiffIndex\": \"Index\",\n  \"settingsGitDiffHead\": \"HEAD\",\n  \"settingsFallbackEncoding\": \"Fallback Encoding\",\n  \"settingsIndentation\": \"Indentation\",\n  \"settingsTabSize\": \"Tab Size\",\n  \"settingsTabSizeDesc\": \"Columns a tab and a level of indentation take\",\n  \"settingsTabSizeSmaller\": \"Decrease tab size\",\n  \"settingsTabSizeLarger\": \"Increase tab size\",\n  \"settingsIndentWith\": \"Indent With\",\n  \"settingsIndentWithDesc\": \"Follow Language: tabs for Go, spaces for others\",\n  \"settingsFollowLanguage\": \"Follow Language\",\n  \"settingsTabs\": \"Tabs\",\n  \"settingsSpaces\": \"Spaces\",\n  \"settingsDetectIndentation\": \"Detect Indentation\",\n  \"settingsDetectIndentationDesc\": \"Opens each file with the indentation its lines use\",\n  \"settingsOnSave\": \"On Save\",\n  \"settingsTrimWhiteSpace\": \"Trim Trailing White Space\",\n  \"settingsTrimWhiteSpaceDesc\": \"Removes spaces and tabs at the end of each line\",\n  \"settingsEnsureNewline\": \"Ensure Newline at End of File\",\n  \"settingsEnsureNewlineDesc\": \"Adds a newline to a file that does not end with one\",\n  \"settingsDiffLayout\": \"Diff Layout\",\n  \"settingsClose\": \"Close\",\n  \"settingsLanguage\": \"Language\",\n  \"settingsLanguageDesc\": \"Follow System uses your preferred language\",\n  \"settingsFollowSystem\": \"Follow System\",\n  \"settingsFile\": \"Settings File\",\n  \"settingsFileDesc\": \"All settings are saved to settings.json\",\n  \"settingsOpenFile\": \"Open in Editor\",\n  \"settingsMode\": \"Color Mode\",\n  \"settingsModeDesc\": \"Follow System switches between light and dark with the system\",\n  \"settingsLayoutStyle\": \"Layout Style\",\n  \"settingsFileIcons\": \"File Icons\",\n  \"settingsSystem\": \"System\",\n  \"settingsLightTheme\": \"Light Theme\",\n  \"settingsDarkTheme\": \"Dark Theme\",\n  \"settingsInUse\": \"In Use\",\n  \"settingsUIFont\": \"Interface Font\",\n  \"settingsUIFontDesc\": \"Side bar, tab bar and panels\",\n  \"settingsContentFont\": \"Content Font\",\n  \"settingsContentFontDesc\": \"Text in the editor\",\n  \"settingsFontSize\": \"Font Size\",\n  \"settingsFontSizeDesc\": \"Size of the content font\",\n  \"settingsSmaller\": \"Decrease font size\",\n  \"settingsLarger\": \"Increase font size\",\n  \"settingsPreview\": \"Preview\",\n  \"settingsSystemDefault\": \"System Default\",\n  \"settingsSystemMono\": \"System Monospace\",\n  \"settingsShortcuts\": \"Shortcuts\",\n  \"settingsShortcutsSearch\": \"Search commands\",\n  \"settingsShortcutsResetAll\": \"Restore All Defaults\",\n  \"settingsShortcutsResetAllConfirm\": \"Restore the default shortcuts of all commands?\",\n  \"settingsShortcutsConflicts\": \"{count, plural, one {# shortcut is shared by commands; it runs the one set last} other {# shortcuts are shared by commands; each runs the one set last}}\",\n  \"@settingsShortcutsConflicts\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"2\" } }\n  },\n  \"settingsShortcutsOnlyConflicts\": \"Show Conflicts\",\n  \"settingsShortcutsShowAll\": \"Show All\",\n  \"settingsShortcutsCommands\": \"{count, plural, one {# command} other {# commands}}\",\n  \"@settingsShortcutsCommands\": {\n    \"placeholders\": { \"count\": { \"type\": \"int\", \"example\": \"2\" } }\n  },\n  \"settingsShortcutsResolve\": \"Remove or change the shortcut of either command to resolve a conflict.\",\n  \"settingsShortcutsNone\": \"No commands match\",\n  \"settingsShortcutModified\": \"Modified\",\n  \"settingsShortcutAdd\": \"Add Shortcut\",\n  \"settingsShortcutReset\": \"Restore Default\",\n  \"settingsShortcutRemove\": \"Remove {key}\",\n  \"@settingsShortcutRemove\": {\n    \"description\": \"The button taking a shortcut away from a command, to assistive technology.\",\n    \"placeholders\": { \"key\": { \"type\": \"String\", \"example\": \"⇧⌘D\" } }\n  },\n  \"settingsShortcutRecord\": \"Shortcut for {name}\",\n  \"@settingsShortcutRecord\": {\n    \"description\": \"The field recording a shortcut, to assistive technology.\",\n    \"placeholders\": { \"name\": { \"type\": \"String\", \"example\": \"Word Wrap\" } }\n  },\n  \"settingsShortcutPress\": \"Press shortcut…\",\n  \"settingsShortcutRecordHint\": \"Press a key combination, or {chord} then a key for a chord. Escape cancels.\",\n  \"@settingsShortcutRecordHint\": {\n    \"placeholders\": { \"chord\": { \"type\": \"String\", \"example\": \"⌘K\" } }\n  },\n  \"settingsShortcutChordHint\": \"Press the chord's second key. Escape cancels.\",\n  \"settingsShortcutNeedsModifier\": \"Add a modifier key, or use a function key.\",\n  \"settingsShortcutReserved\": \"{key} is used by the system or the editor.\",\n  \"@settingsShortcutReserved\": {\n    \"placeholders\": { \"key\": { \"type\": \"String\", \"example\": \"⌘Q\" } }\n  },\n  \"settingsShortcutTaken\": \"{key} is used by\",\n  \"@settingsShortcutTaken\": {\n    \"description\": \"Heads the list of the commands a shortcut being set already runs.\",\n    \"placeholders\": { \"key\": { \"type\": \"String\", \"example\": \"⌘D\" } }\n  },\n  \"settingsShortcutReplaceOne\": \"Replace removes {key} from “{name}”\",\n  \"@settingsShortcutReplaceOne\": {\n    \"placeholders\": {\n      \"key\": { \"type\": \"String\", \"example\": \"⌘D\" },\n      \"name\": { \"type\": \"String\", \"example\": \"Quick Add Next\" }\n    }\n  },\n  \"settingsShortcutReplaceMany\": \"Replace removes {key} from these commands\",\n  \"@settingsShortcutReplaceMany\": {\n    \"placeholders\": { \"key\": { \"type\": \"String\", \"example\": \"⌘D\" } }\n  },\n  \"settingsShortcutKeepBoth\": \"Keep Both\",\n  \"settingsShortcutReplace\": \"Replace\",\n  \"shortcutGroupEdit\": \"Edit\",\n  \"shortcutGroupText\": \"Text\",\n  \"shortcutGroupSelection\": \"Selection\",\n  \"shortcutGroupFolding\": \"Code Folding\",\n  \"shortcutGroupTabs\": \"Tabs\",\n  \"shortcutGroupLayout\": \"Layout and Groups\",\n  \"shortcutGroupGit\": \"Git\",\n  \"shortcutToggleBlame\": \"Toggle Blame\",\n  \"shortcutToggleInlineBlame\": \"Toggle Inline Blame\",\n  \"shortcutSoftUndo\": \"Undo Selection\",\n  \"shortcutSoftRedo\": \"Redo Selection\",\n  \"shortcutIndent\": \"Indent\",\n  \"shortcutUnindent\": \"Unindent\",\n  \"shortcutInsertLineAfter\": \"Insert Line After\",\n  \"shortcutInsertLineBefore\": \"Insert Line Before\",\n  \"shortcutTranspose\": \"Transpose\",\n  \"shortcutDeleteToEnd\": \"Delete to End of Line\",\n  \"shortcutDeleteToStart\": \"Delete to Start of Line\",\n  \"shortcutShowCompletions\": \"Show Completions\",\n  \"shortcutSelectLine\": \"Select Line\",\n  \"shortcutExpandSelection\": \"Expand Selection\",\n  \"shortcutAddCursorAbove\": \"Add Cursor Above\",\n  \"shortcutAddCursorBelow\": \"Add Cursor Below\",\n  \"shortcutMoveToBracket\": \"Jump to Matching Bracket\",\n  \"shortcutSelectColorScheme\": \"Select Color Scheme\",\n  \"shortcutScrollToCursor\": \"Scroll to Cursor\",\n  \"shortcutFold\": \"Fold\",\n  \"shortcutUnfold\": \"Unfold\",\n  \"shortcutFoldAll\": \"Fold All\",\n  \"shortcutUnfoldAll\": \"Unfold All\",\n  \"shortcutFoldLevel\": \"Fold Level {level}\",\n  \"@shortcutFoldLevel\": {\n    \"placeholders\": { \"level\": { \"type\": \"int\", \"example\": \"2\" } }\n  },\n  \"shortcutGotoDefinition\": \"Goto Definition\",\n  \"shortcutNextResult\": \"Next Result\",\n  \"shortcutPrevResult\": \"Previous Result\",\n  \"shortcutNextTab\": \"Next Tab\",\n  \"shortcutPrevTab\": \"Previous Tab\",\n  \"shortcutNextTabInStack\": \"Next Recently Used Tab\",\n  \"shortcutPrevTabInStack\": \"Previous Recently Used Tab\",\n  \"shortcutSelectTab\": \"Select Tab {index}\",\n  \"@shortcutSelectTab\": {\n    \"placeholders\": { \"index\": { \"type\": \"int\", \"example\": \"3\" } }\n  },\n  \"shortcutSelectLastTab\": \"Select Last Tab\",\n  \"shortcutFocusNextGroup\": \"Focus Next Group\",\n  \"shortcutFocusPrevGroup\": \"Focus Previous Group\",\n  \"shortcutMoveToNextGroup\": \"Move to Next Group\",\n  \"shortcutMoveToPrevGroup\": \"Move to Previous Group\",\n  \"shortcutFocusGroup\": \"Focus Group {index}\",\n  \"@shortcutFocusGroup\": {\n    \"placeholders\": { \"index\": { \"type\": \"int\", \"example\": \"2\" } }\n  },\n  \"shortcutMoveToGroup\": \"Move to Group {index}\",\n  \"@shortcutMoveToGroup\": {\n    \"placeholders\": { \"index\": { \"type\": \"int\", \"example\": \"2\" } }\n  }\n}\n","// Lime is a plain text editor in the manner of Sublime Text, without\n// packages: tabs, groups, Goto Anything, the command palette, a side bar\n// of folders, syntax highlighting, word wrap, several carets and column\n// selection, on Sublime Text's keys.\npackage main\n\nimport (\n\t\"errors\"\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/egoist/mygo\"\n\t\"github.com/egoist/mygo/ui\"\n\t\"github.com/egoist/mygo/ui/editor\"\n\n\t\"lime/locales\"\n)\n\n// makeWindow opens the window of a, at r unless r is empty, the first\n// window where it was last.\nfunc (a *app) makeWindow(r mygo.Rectangle) {\n\to := mygo.WindowOptions{Title: \"Lime\", Width: 1100, Height: 760, MinWidth: 480, MinHeight: 320, Content: ui.View(a.view)}\n\tswitch {\n\tcase a == a.l.wins[0]:\n\t\to.StateKey = \"main\"\n\tcase r.Width \u003e 0:\n\t\to.X, o.Y, o.Width, o.Height = r.X, r.Y, r.Width, r.Height\n\t}\n\tif mac {\n\t\to.Vibrancy, o.TitleBarStyle = mygo.VibrancySidebar, mygo.TitleBarHidden\n\t}\n\ta.win = mygo.NewWindow(o)\n\ta.win.OnFocus(func() {\n\t\ta.l.last, a.l.menuState = a, menuStateKey{}\n\t\ta.syncMenu()\n\t\ta.reloadChanged()\n\t\ta.readGit()\n\t\ta.readMarks()\n\t\tif !watchDirs {\n\t\t\ta.proj.clearDirs()\n\t\t}\n\t})\n\ta.win.OnClose(a.closing)\n\ta.win.OnClosed(func() { a.l.closed(a) })\n}\n\nfunc main() {\n\tinitUpdater()\n\tl := newLime(dataDir())\n\tonIconFontLoaded = l.redraw\n\tl.restoreSession()\n\tif len(l.wins) == 0 {\n\t\tl.newWindow()\n\t}\n\tl.themeSource = themeSource(l.set.Appearance)\n\tmygo.Theme.SetSource(l.themeSource)\n\tmygo.App.SetLocale(l.set.locale())\n\tl.last.openCLI(os.Args[1:])\n\tfor _, a := range l.wins {\n\t\tif a.docCount() == 0 {\n\t\t\ta.newFile()\n\t\t}\n\t}\n\t// Finder, the Dock and open(1) pass files here, not in os.Args.\n\tmygo.App.OnOpenFile(func(path string) {\n\t\tif len(l.wins) == 0 {\n\t\t\tl.reopen()\n\t\t}\n\t\ta := l.last\n\t\tif a.win == nil {\n\t\t\t// The files the app is launched with come before its windows.\n\t\t\ta.open([]string{path})\n\t\t\treturn\n\t\t}\n\t\ta.win.Update(func() { a.open([]string{path}) })\n\t})\n\tmygo.App.WhenReady(func() {\n\t\tl.menu = l.newMenu()\n\t\tmygo.App.SetMenu(l.menu)\n\t\t// The menu's labels are said once, in the language shown as it is\n\t\t// made.\n\t\tmygo.App.OnLocaleChanged(func(string) { l.refreshMenu() })\n\t\tfor _, a := range l.wins {\n\t\t\ta.makeWindow(a.bounds)\n\t\t}\n\t\tmygo.App.OnBeforeQuit(func(e *mygo.QuitEvent) { l.quit(e) })\n\t\tif mac {\n\t\t\t// A listener, though it does nothing, keeps the app running.\n\t\t\tmygo.App.OnWindowAllClosed(func() {})\n\t\t\tmygo.App.OnActivate(func(bool) {\n\t\t\t\tif len(l.wins) == 0 {\n\t\t\t\t\tl.reopen()\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tif err := l.setErr; err != nil {\n\t\t\tgo mygo.Dialog.Error(locales.DialogUnableToReadSettings(), err.Error())\n\t\t}\n\t\tgo func() {\n\t\t\tfor range time.Tick(3 * time.Second) {\n\t\t\t\tmygo.RunOnMain(l.tick)\n\t\t\t}\n\t\t}()\n\t})\n\tif err := mygo.App.Run(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\ntype openArg struct {\n\tpath      string\n\tline, col int\n}\n\nfunc parseCLIArgs(args []string) []openArg {\n\tvar out []openArg\n\tliteral := false\n\tfor _, arg := range args {\n\t\tif !literal {\n\t\t\tif arg == \"--\" {\n\t\t\t\tliteral = true\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif strings.HasPrefix(arg, \"-\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tout = append(out, parseOpenArg(arg))\n\t}\n\treturn out\n}\n\nfunc parseOpenArg(arg string) openArg {\n\tif _, err := os.Stat(arg); err == nil {\n\t\treturn openArg{path: arg}\n\t}\n\tb1, n1, ok := splitTrailingInt(arg)\n\tif !ok {\n\t\treturn openArg{path: arg}\n\t}\n\tif b2, n2, ok := splitTrailingInt(b1); ok {\n\t\tif _, err := os.Stat(b1); err == nil {\n\t\t\treturn openArg{path: b1, line: n1}\n\t\t}\n\t\treturn openArg{path: b2, line: n2, col: n1}\n\t}\n\treturn openArg{path: b1, line: n1}\n}\n\nfunc splitTrailingInt(s string) (string, int, bool) {\n\ti := strings.LastIndexByte(s, ':')\n\tif i \u003c= 0 || i == len(s)-1 {\n\t\treturn \"\", 0, false\n\t}\n\ttail := s[i+1:]\n\tfor j := range len(tail) {\n\t\tif tail[j] \u003c '0' || tail[j] \u003e '9' {\n\t\t\treturn \"\", 0, false\n\t\t}\n\t}\n\tn, err := strconv.Atoi(tail)\n\tif err != nil || n \u003c= 0 {\n\t\treturn \"\", 0, false\n\t}\n\treturn s[:i], n, true\n}\n\nfunc (a *app) openCLI(args []string) {\n\tfor _, arg := range parseCLIArgs(args) {\n\t\tp, _ := filepath.Abs(arg.path)\n\t\tif d := a.docAt(p); d != nil {\n\t\t\ta.show(d)\n\t\t\tgoToPos(d, arg.line, arg.col)\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := os.Stat(p); errors.Is(err, os.ErrNotExist) {\n\t\t\td := a.add(p, \"\")\n\t\t\tgoToPos(d, arg.line, arg.col)\n\t\t\tcontinue\n\t\t}\n\t\ta.open([]string{p})\n\t\tif arg.line \u003e 0 {\n\t\t\tif d := a.docAt(p); d != nil {\n\t\t\t\tgoToPos(d, arg.line, arg.col)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc goToPos(d *doc, line, col int) {\n\tif d == nil || d.kind != textDoc || line \u003c= 0 {\n\t\treturn\n\t}\n\tbuf := d.st.Buffer\n\tl := min(line, buf.LineCount()) - 1\n\tbyteCol := 0\n\tif col \u003e 1 {\n\t\ts := buf.Line(l)\n\t\trem := col - 1\n\t\tfor i := range s {\n\t\t\tif rem == 0 {\n\t\t\t\tbyteCol = i\n\t\t\t\trem = -1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\trem--\n\t\t}\n\t\tif rem \u003e= 0 {\n\t\t\tbyteCol = len(s)\n\t\t}\n\t}\n\td.st.GoTo(editor.Pos{Line: l, Col: byteCol})\n}\n","package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/egoist/mygo\"\n\t\"github.com/egoist/mygo/ui/editor\"\n\n\t\"lime/locales\"\n)\n\n// command is something keys, menus and the command palette run, by the\n// name of Sublime Text's command where it has one.\ntype command struct {\n\tid      string\n\tcaption func(locales.Messages) string // nil keeps it out of the command palette\n\trun     func(a *app)\n\ted      editor.Command    // the editor's command it runs, whose keys the editor takes\n\tenabled func(a *app) bool // nil for always; the command palette lists it only while true\n}\n\nfunc foldLevel(n int) string   { return \"fold_by_level \" + strconv.Itoa(n) }\nfunc focusGroup(i int) string  { return \"focus_group \" + strconv.Itoa(i) }\nfunc moveToGroup(i int) string { return \"move_to_group \" + strconv.Itoa(i) }\nfunc selectTab(i int) string   { return \"select_by_index \" + strconv.Itoa(i) }\n\nfunc withDoc(fn func(a *app, d *doc)) func(a *app) {\n\treturn func(a *app) {\n\t\tif d := a.current(); d != nil \u0026\u0026 d.kind == textDoc {\n\t\t\tfn(a, d)\n\t\t}\n\t}\n}\n\nfunc withSource(fn func(a *app, d *doc)) func(a *app) {\n\treturn func(a *app) {\n\t\tif d := a.current(); d != nil \u0026\u0026 d.source().kind == textDoc {\n\t\t\tfn(a, d.source())\n\t\t}\n\t}\n}\n\nfunc edit(id string, caption func(locales.Messages) string, cmd editor.Command) command {\n\treturn command{id: id, caption: caption, run: func(a *app) {\n\t\tswitch d := a.current(); {\n\t\tcase d == nil:\n\t\tcase d.cmp != nil:\n\t\t\td.cmp.diff.Run(cmd)\n\t\tcase d.kind == textDoc:\n\t\t\td.st.Run(cmd)\n\t\t}\n\t}, ed: cmd}\n}\n\nfunc currentTracked(a *app) bool {\n\td := a.current()\n\treturn d != nil \u0026\u0026 a.tracked(d.path)\n}\n\nfunc currentMarkdown(a *app) bool {\n\td := a.current()\n\treturn d != nil \u0026\u0026 d.markdown()\n}\n\nfunc currentSaved(a *app) bool {\n\td := a.current()\n\treturn d != nil \u0026\u0026 d.path != \"\"\n}\n\nfunc currentInProject(a *app) bool {\n\td := a.current()\n\treturn d != nil \u0026\u0026 d.path != \"\" \u0026\u0026 a.proj.holds(d.path)\n}\n\nfunc currentRevertable(a *app) bool {\n\td := a.current()\n\treturn d != nil \u0026\u0026 d.kind == textDoc \u0026\u0026 d.path != \"\"\n}\n\nfunc (a *app) closeOtherTabs(g *group, keep *doc) {\n\tfor _, d := range slices.Clone(g.docs) {\n\t\tif d == keep || keep.cmp != nil \u0026\u0026 (keep.cmp.src == d || keep.cmp.old == d) || keep.md != nil \u0026\u0026 keep.md.src == d {\n\t\t\tcontinue\n\t\t}\n\t\ta.closeDoc(d)\n\t}\n}\n\nfunc (a *app) revealInSideBar(path string) {\n\tif path == \"\" || !a.proj.holds(path) {\n\t\treturn\n\t}\n\ta.revealPath = path\n\tif a.side != filesPanel {\n\t\ta.showPanel(filesPanel)\n\t}\n\tfor _, f := range a.proj.folders {\n\t\tif !within(path, f) {\n\t\t\tcontinue\n\t\t}\n\t\tfor dir := filepath.Dir(path); within(dir, f); dir = filepath.Dir(dir) {\n\t\t\t*a.proj.isOpen(dir, true) = true\n\t\t\tif dir == f {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tbreak\n\t}\n}\n\nfunc (a *app) revert(d *doc) {\n\tif d == nil || d.kind != textDoc || d.path == \"\" {\n\t\treturn\n\t}\n\tif !d.dirty() {\n\t\ta.revertDoc(d)\n\t\treturn\n\t}\n\tname := d.name()\n\twin := a.win\n\tgo func() {\n\t\tres, err := mygo.Dialog.Message(mygo.MessageOptions{\n\t\t\tParent:             win,\n\t\t\tType:               mygo.MessageWarning,\n\t\t\tMessage:            locales.DialogRevertFile(name),\n\t\t\tDetail:             locales.DialogUnsavedLost(),\n\t\t\tButtons:            []string{locales.ButtonRevert(), locales.ButtonCancel()},\n\t\t\tDestructiveButtons: []int{0},\n\t\t\tCancelButton:       1,\n\t\t})\n\t\tif err == nil \u0026\u0026 res.Button == 0 \u0026\u0026 win != nil {\n\t\t\twin.Update(func() {\n\t\t\t\tif gi, _ := a.locate(d); gi \u003e= 0 {\n\t\t\t\t\ta.revertDoc(d)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}()\n}\n\nfunc (a *app) revertDoc(d *doc) {\n\tif d == nil || d.kind != textDoc || d.path == \"\" {\n\t\treturn\n\t}\n\tpath, version, encoding, fallback := d.path, d.st.Buffer.Version(), d.encoding(), a.set.FallbackEncoding\n\ta.background(func() func() {\n\t\tdisk := stampOf(path)\n\t\traw, err := readText(path)\n\t\tif err != nil {\n\t\t\treturn func() { go mygo.Dialog.Error(locales.DialogUnableToOpen(filepath.Base(path)), err.Error()) }\n\t\t}\n\t\ttext, enc := reopenText(raw, encoding, fallback)\n\t\ttext, ending := splitLines(text)\n\t\treturn func() {\n\t\t\tif a.l.owner(d) != a || d.path != path || d.st.Buffer.Version() != version {\n\t\t\t\treturn\n\t\t\t}\n\t\t\td.enc = enc\n\t\t\td.st.Buffer.Set(text)\n\t\t\td.setLineEnding(ending)\n\t\t\td.savedEnding = ending\n\t\t\td.st.Buffer.MarkSaved()\n\t\t\td.saved = d.st.Buffer.Snapshot()\n\t\t\tif d.base == \"\" || d.saved.Len() \u003e largeFile {\n\t\t\t\td.diffDisk()\n\t\t\t}\n\t\t\ta.l.diskChanged(d)\n\t\t\td.disk = disk\n\t\t\ta.readBases(d)\n\t\t}\n\t})\n}\n\n// convertCase runs cmd, which converts the case of the selections, on\n// them as caseSpans readies them, or as edit does in a diff tab, whose\n// selections MyGo keeps to itself. It gives the editor no key, which would\n// run cmd on the selections as they are.\nfunc convertCase(id string, caption func(locales.Messages) string, cmd editor.Command, trim bool) command {\n\treturn command{id: id, caption: caption, run: func(a *app) {\n\t\tswitch d := a.current(); {\n\t\tcase d == nil:\n\t\tcase d.cmp != nil:\n\t\t\td.cmp.diff.Run(cmd)\n\t\tcase d.kind == textDoc:\n\t\t\tcaseSpans(d.st, trim, func() { d.st.Run(cmd) })\n\t\t}\n\t}}\n}\n\nfunc (a *app) setFontSize(size float32) {\n\ta.set.FontSize = max(8, min(size, 48))\n\ta.l.saveSettings()\n}\n\n// commands and commandByID are set by init: the commands' functions read\n// them, which their initializers could not.\nvar (\n\tcommands    []command\n\tcommandByID map[string]*command\n)\n\nfunc init() {\n\tcommands = makeCommands()\n\tcommandByID = make(map[string]*command, len(commands))\n\tfor i := range commands {\n\t\tcommandByID[commands[i].id] = \u0026commands[i]\n\t}\n\tinitKeys()\n}\n\nfunc makeCommands() []command {\n\tc := []command{\n\t\t{id: \"new_file\", caption: locales.Messages.CmdNewFile, run: (*app).newFile},\n\t\t{id: \"prompt_open\", caption: locales.Messages.CmdOpen, run: (*app).promptOpen},\n\t\t{id: \"prompt_open_folder\", caption: locales.Messages.CmdOpenFolder, run: (*app).promptAddFolder},\n\t\t{id: \"reopen_last_file\", caption: locales.Messages.CmdReopenClosedFile, run: (*app).reopenClosed},\n\t\t{id: \"save\", caption: locales.Messages.CmdSave, run: withSource((*app).save)},\n\t\t{id: \"prompt_save_as\", caption: locales.Messages.CmdSaveAs, run: withSource((*app).saveAs)},\n\t\t{id: \"save_all\", caption: locales.Messages.CmdSaveAll, run: (*app).saveAll},\n\t\t{id: \"revert\", caption: locales.Messages.CmdRevertFile, enabled: currentRevertable, run: withDoc((*app).revert)},\n\t\t{id: \"close\", caption: locales.Messages.CmdClose, run: (*app).closeCurrent},\n\t\t{id: \"close_other_tabs\", caption: locales.Messages.CmdCloseOtherTabs, enabled: func(a *app) bool { return len(a.group().docs) \u003e 1 }, run: func(a *app) {\n\t\t\tif d := a.current(); d != nil {\n\t\t\t\ta.closeOtherTabs(a.group(), d)\n\t\t\t}\n\t\t}},\n\t\t{id: \"copy_path\", caption: locales.Messages.CmdCopyPath, enabled: currentSaved, run: func(a *app) {\n\t\t\tif d := a.current(); d != nil \u0026\u0026 d.path != \"\" {\n\t\t\t\tmygo.Clipboard.WriteText(d.path)\n\t\t\t}\n\t\t}},\n\t\t{id: \"reveal_in_side_bar\", caption: locales.Messages.CmdRevealInSideBar, enabled: currentInProject, run: func(a *app) {\n\t\t\tif d := a.current(); d != nil {\n\t\t\t\ta.revealInSideBar(d.path)\n\t\t\t}\n\t\t}},\n\t\t{id: \"reveal_in_finder\", caption: locales.Messages.CmdRevealInFinder, enabled: currentSaved, run: func(a *app) {\n\t\t\tif d := a.current(); d != nil \u0026\u0026 d.path != \"\" {\n\t\t\t\tmygo.Shell.ShowItemInFolder(d.path)\n\t\t\t}\n\t\t}},\n\t\t{id: \"new_window\", caption: locales.Messages.CmdNewWindow, run: (*app).openWindow},\n\t\t{id: \"close_window\", caption: locales.Messages.CmdCloseWindow, run: func(a *app) { a.win.Close() }},\n\n\t\t{id: \"show_goto\", caption: locales.Messages.CmdGotoAnything, run: func(a *app) { a.showGoto(\"\") }},\n\t\t{id: \"show_command_palette\", run: (*app).showCommandPalette},\n\t\t{id: \"goto_line\", caption: locales.Messages.CmdGotoLine, run: func(a *app) { a.showGoto(\":\") }},\n\t\t{id: \"goto_symbol\", caption: locales.Messages.CmdGotoSymbol, run: func(a *app) { a.showGoto(\"@\") }},\n\t\t{id: \"jump_back\", caption: locales.Messages.CmdJumpBack, run: func(a *app) { a.jump(\u0026a.jumps.back, \u0026a.jumps.forward) }},\n\t\t{id: \"jump_forward\", caption: locales.Messages.CmdJumpForward, run: func(a *app) { a.jump(\u0026a.jumps.forward, \u0026a.jumps.back) }},\n\t\t{id: \"show_panel find\", run: func(a *app) { a.showFind(false) }},\n\t\t{id: \"show_panel replace\", run: func(a *app) { a.showFind(true) }},\n\t\t{id: \"show_panel find_in_files\", run: func(a *app) { a.showFindInFiles(\"\") }},\n\t\t{id: \"next_result\", run: func(a *app) { a.stepResult(1) }},\n\t\t{id: \"prev_result\", run: func(a *app) { a.stepResult(-1) }},\n\t\t{id: \"next_view\", run: func(a *app) { a.selectTab(a.group().active + 1) }},\n\t\t{id: \"prev_view\", run: func(a *app) { a.selectTab(a.group().active - 1) }},\n\t\t{id: \"next_view_in_stack\", run: func(a *app) { a.cycleTabs(1) }},\n\t\t{id: \"prev_view_in_stack\", run: func(a *app) { a.cycleTabs(-1) }},\n\t\t{id: \"select_last_tab\", run: func(a *app) { a.selectTab(-1) }},\n\n\t\t{id: \"toggle_side_bar\", caption: locales.Messages.CmdToggleSideBar, run: func(a *app) {\n\t\t\tp := filesPanel\n\t\t\tif a.side != noPanel {\n\t\t\t\tp = noPanel\n\t\t\t}\n\t\t\ta.showPanel(p)\n\t\t}},\n\t\t{id: \"toggle_files_panel\", caption: locales.Messages.CmdToggleFilesPanel, run: func(a *app) { a.togglePanel(filesPanel) }},\n\t\t{id: \"toggle_git_panel\", caption: locales.Messages.CmdToggleGitPanel, run: func(a *app) { a.togglePanel(gitPanel) }},\n\t\t{id: \"toggle_word_wrap\", caption: locales.Messages.CmdToggleWordWrap, run: func(a *app) {\n\t\t\ta.set.WordWrap = !a.set.WordWrap\n\t\t\ta.l.saveSettings()\n\t\t}},\n\t\t{id: \"toggle_rampage_mode\", caption: locales.Messages.CmdToggleRampageMode, run: func(a *app) {\n\t\t\tif a.set.rampage() {\n\t\t\t\ta.set.TypingMode = normalTyping\n\t\t\t} else {\n\t\t\t\ta.set.TypingMode = rampageTyping\n\t\t\t}\n\t\t\ta.l.saveSettings()\n\t\t}},\n\t\t{id: \"increase_font_size\", caption: locales.Messages.CmdIncreaseFontSize, run: func(a *app) { a.setFontSize(a.set.FontSize + 1) }},\n\t\t{id: \"decrease_font_size\", caption: locales.Messages.CmdDecreaseFontSize, run: func(a *app) { a.setFontSize(a.set.FontSize - 1) }},\n\t\t{id: \"reset_font_size\", caption: locales.Messages.CmdResetFontSize, run: func(a *app) { a.setFontSize(defaultFontSize) }},\n\t\t{id: \"show_settings\", caption: locales.Messages.CmdSettings, run: (*app).showSettings},\n\t\t{id: \"select_color_scheme\", caption: locales.Messages.CmdSelectColorScheme, run: (*app).showSchemes},\n\t\t{id: \"select_syntax\", caption: locales.Messages.CmdSetSyntax, run: (*app).showSyntaxes},\n\t\t{id: \"new_pane\", caption: locales.Messages.CmdNewPane, run: (*app).newPane},\n\t\t{id: \"close_pane\", caption: locales.Messages.CmdClosePane, run: (*app).closePane},\n\t\t{id: \"focus_next_group\", run: func(a *app) { a.focusGroup(a.neighbor(1)) }},\n\t\t{id: \"focus_prev_group\", run: func(a *app) { a.focusGroup(a.neighbor(-1)) }},\n\t\t{id: \"move_to_next_group\", run: func(a *app) { a.moveToGroup(a.neighbor(1)) }},\n\t\t{id: \"move_to_prev_group\", run: func(a *app) { a.moveToGroup(a.neighbor(-1)) }},\n\n\t\t{id: \"prompt_add_folder\", caption: locales.Messages.CmdAddFolder, run: (*app).promptAddFolder},\n\t\t{id: \"prompt_open_project\", caption: locales.Messages.CmdOpenProject, run: (*app).promptOpenProject},\n\t\t{id: \"prompt_select_workspace\", caption: locales.Messages.CmdQuickSwitchProject, run: (*app).showWorkspaces},\n\t\t{id: \"save_project_as\", caption: locales.Messages.CmdSaveProjectAs, run: (*app).promptSaveProject},\n\t\t{id: \"close_project\", caption: locales.Messages.CmdCloseProject, run: (*app).closeProject},\n\t\t{id: \"refresh_folders\", caption: locales.Messages.CmdRefreshFolders, run: (*app).refreshFolders},\n\n\t\t{id: \"git_create_branch\", caption: realGit(locales.Messages.CmdCreateBranch), run: inRepo((*app).promptCreateBranch)},\n\t\t{id: \"git_delete_branch\", caption: realGit(locales.Messages.CmdDeleteBranch), run: inRepo((*app).showDeleteBranch)},\n\t\t{id: \"git_rename_branch\", caption: realGit(locales.Messages.CmdRenameBranch), run: inRepo((*app).promptRenameBranch)},\n\t\t{id: \"git_uncommit\", caption: realGit(locales.Messages.CmdUncommit), run: inRepo((*app).uncommit)},\n\t\t{id: \"git_push\", caption: realGit(locales.Messages.CmdPush), run: inRepo((*app).push)},\n\t\t{id: \"git_pull\", caption: realGit(locales.Messages.CmdPull), run: inRepo((*app).pull)},\n\t\t{id: \"git_fetch\", caption: realGit(locales.Messages.CmdFetch), run: inRepo((*app).fetch)},\n\t\t{id: \"sublime_merge_file_history\", caption: locales.Messages.CmdFileHistory, enabled: currentTracked, run: func(a *app) {\n\t\t\tif currentTracked(a) {\n\t\t\t\ta.fileHistory(a.current().path)\n\t\t\t}\n\t\t}},\n\t\t{id: \"toggle_blame\", caption: locales.Messages.CmdToggleBlame, enabled: currentBlameable, run: (*app).toggleBlame},\n\t\t{id: \"toggle_inline_blame\", caption: locales.Messages.CmdToggleInlineBlame, run: func(a *app) {\n\t\t\ta.set.InlineBlame = !a.set.InlineBlame\n\t\t\ta.l.saveSettings()\n\t\t}},\n\t\t{id: \"copy_permalink_to_line\", caption: locales.Messages.CmdCopyPermalink, enabled: currentLinkable, run: func(a *app) { a.permalink(a.current(), false) }},\n\t\t{id: \"open_permalink_to_line\", caption: locales.Messages.CmdOpenOnGitHub, enabled: currentLinkable, run: func(a *app) { a.permalink(a.current(), true) }},\n\n\t\tconvertCase(\"upper_case\", locales.Messages.CmdUpperCase, editor.Uppercase, false),\n\t\tconvertCase(\"lower_case\", locales.Messages.CmdLowerCase, editor.Lowercase, false),\n\t\tconvertCase(\"title_case\", locales.Messages.CmdTitleCase, editor.TitleCase, false),\n\t\t{id: \"swap_case\", caption: locales.Messages.CmdSwapCase, run: withDoc(func(_ *app, d *doc) {\n\t\t\tcaseSpans(d.st, false, func() { swapCase(d.st) })\n\t\t})},\n\t\tconvertCase(\"convert_to_snake\", locales.Messages.CmdSnakeCase, editor.SnakeCase, true),\n\t\tconvertCase(\"convert_to_dash\", locales.Messages.CmdKebabCase, editor.KebabCase, true),\n\t\tconvertCase(\"convert_to_camel\", locales.Messages.CmdCamelCase, editor.CamelCase, true),\n\t\tconvertCase(\"convert_to_pascal\", locales.Messages.CmdPascalCase, editor.PascalCase, true),\n\t\tedit(\"sort_lines\", locales.Messages.CmdSortLines, editor.SortLinesCaseInsensitive),\n\t\tedit(\"sort_lines_case_sensitive\", locales.Messages.CmdSortLinesCaseSensitive, editor.SortLines),\n\t\tedit(\"reverse_lines\", locales.Messages.CmdReverseLines, editor.ReverseLines),\n\t\tedit(\"unique_lines\", locales.Messages.CmdUniqueLines, editor.UniqueLines),\n\t\t{id: \"delete_blank_lines\", caption: locales.Messages.CmdDeleteBlankLines, run: withDoc(func(_ *app, d *doc) { deleteBlankLines(d.st, false) })},\n\t\t{id: \"delete_blank_lines surplus\", caption: locales.Messages.CmdDeleteSurplusBlankLines, run: withDoc(func(_ *app, d *doc) { deleteBlankLines(d.st, true) })},\n\t\t{id: \"format_json\", caption: locales.Messages.CmdFormatJSON, run: withDoc(func(a *app, d *doc) { a.formatJSON(d.st, false) })},\n\t\t{id: \"minify_json\", caption: locales.Messages.CmdMinifyJSON, run: withDoc(func(a *app, d *doc) { a.formatJSON(d.st, true) })},\n\t\t{id: \"compare_with\", caption: locales.Messages.CmdCompareWith, run: withDoc((*app).showCompare)},\n\t\t{id: \"compare_with_clipboard\", caption: locales.Messages.CmdCompareWithClipboard, run: withDoc((*app).compareClipboard)},\n\t\t{id: \"diff_changes\", caption: locales.Messages.CmdShowUnsavedChanges, run: withDoc((*app).showUnsavedChanges)},\n\t\t{id: \"open_markdown_preview\", caption: locales.Messages.CmdOpenPreview, enabled: currentMarkdown, run: withDoc(func(a *app, d *doc) { a.openPreview(d, false) })},\n\t\t{id: \"open_markdown_preview_to_the_side\", caption: locales.Messages.CmdOpenPreviewToTheSide, enabled: currentMarkdown, run: withDoc(func(a *app, d *doc) { a.openPreview(d, true) })},\n\t\tedit(\"toggle_comment\", locales.Messages.CmdToggleComment, editor.ToggleComment),\n\t\tedit(\"toggle_block_comment\", locales.Messages.CmdToggleBlockComment, editor.ToggleBlockComment),\n\t\tedit(\"split_selection_into_lines\", locales.Messages.CmdSplitSelection, editor.SplitSelectionIntoLines),\n\t\tedit(\"join_lines\", locales.Messages.CmdJoinLines, editor.JoinLines),\n\t\tedit(\"duplicate_line\", locales.Messages.CmdDuplicateLine, editor.DuplicateSelection),\n\t\tedit(\"delete_line\", locales.Messages.CmdDeleteLine, editor.DeleteLine),\n\t\tedit(\"swap_line_up\", locales.Messages.CmdSwapLineUp, editor.MoveLinesUp),\n\t\tedit(\"swap_line_down\", locales.Messages.CmdSwapLineDown, editor.MoveLinesDown),\n\t\tedit(\"trim_trailing_white_space\", locales.Messages.CmdTrimTrailingWhiteSpace, editor.TrimTrailingWhitespace),\n\t\tedit(\"fold_all\", locales.Messages.CmdFoldAll, editor.FoldAll),\n\t\tedit(\"unfold_all\", locales.Messages.CmdUnfoldAll, editor.UnfoldAll),\n\t\tedit(\"next_modification\", locales.Messages.CmdNextModification, editor.NextHunk),\n\t\tedit(\"prev_modification\", locales.Messages.CmdPreviousModification, editor.PreviousHunk),\n\t\tedit(\"revert_hunk\", locales.Messages.CmdRevertHunk, editor.RevertHunk),\n\t\tedit(\"soft_undo\", nil, editor.UndoSelection),\n\t\tedit(\"soft_redo\", nil, editor.RedoSelection),\n\t\tedit(\"indent\", nil, editor.Indent),\n\t\tedit(\"unindent\", nil, editor.Outdent),\n\t\tedit(\"insert_line_after\", nil, editor.NewlineBelow),\n\t\tedit(\"insert_line_before\", nil, editor.NewlineAbove),\n\t\tedit(\"transpose\", nil, editor.Transpose),\n\t\tedit(\"select_line\", nil, editor.SelectLine),\n\t\tedit(\"expand_selection\", nil, editor.SelectLarger),\n\t\tedit(\"add_cursor_above\", nil, editor.AddCursorAbove),\n\t\tedit(\"add_cursor_below\", nil, editor.AddCursorBelow),\n\t\tedit(\"move_to_bracket\", nil, editor.MoveToBracket),\n\t\tedit(\"fold\", nil, editor.Fold),\n\t\tedit(\"unfold\", nil, editor.Unfold),\n\t\tedit(\"goto_definition\", nil, editor.GoToDefinition),\n\t\tedit(\"auto_complete\", nil, editor.ShowCompletions),\n\t\tedit(\"delete_to_eol\", nil, editor.DeleteToLineEnd),\n\t\tedit(\"delete_to_bol\", nil, editor.DeleteToLineStart),\n\t\tedit(\"show_at_center\", nil, editor.ScrollCursorCenter),\n\t\t{id: \"find_next\", run: func(a *app) { a.findStep(editor.FindNext) }},\n\t\t{id: \"find_prev\", run: func(a *app) { a.findStep(editor.FindPrevious) }},\n\t\t{id: \"find_under_expand\", run: quickFind(func(st *editor.State) { st.Run(editor.SelectNext) })},\n\t\t{id: \"find_all_under\", run: quickFind(func(st *editor.State) { st.Run(editor.SelectAllMatches) })},\n\t\t{id: \"find_under_expand_skip\", run: quickFind(skipNext)},\n\t\t{id: \"slurp_find_string\", run: quickFind(func(st *editor.State) { st.Run(editor.UseSelectionForFind) })},\n\t}\n\tfor i := range 9 {\n\t\tc = append(c, edit(foldLevel(i+1), nil, editor.FoldLevel1+editor.Command(i)))\n\t}\n\tfor i := range 4 {\n\t\tc = append(c,\n\t\t\tcommand{id: focusGroup(i), run: func(a *app) { a.focusGroup(i) }},\n\t\t\tcommand{id: moveToGroup(i), run: func(a *app) { a.moveToGroup(i) }})\n\t}\n\tfor i := range 8 {\n\t\tc = append(c, command{id: selectTab(i), run: func(a *app) {\n\t\t\tif g := a.group(); i \u003c len(g.docs) {\n\t\t\t\ta.show(g.docs[i])\n\t\t\t}\n\t\t}})\n\t}\n\tfor _, l := range layouts {\n\t\tcaption := func(m locales.Messages) string { return m.CmdLayout(l.label(m)) }\n\t\tc = append(c, command{id: l.id(), caption: caption, run: func(a *app) { a.setLayout(l) }})\n\t}\n\tfor _, s := range layoutStyles {\n\t\tcaption := func(m locales.Messages) string { return m.CmdLayout(s.label(m)) }\n\t\tc = append(c, command{id: s.id(), caption: caption, run: func(a *app) {\n\t\t\ta.set.LayoutStyle = s.name\n\t\t\ta.l.saveSettings()\n\t\t}})\n\t}\n\tfor _, s := range cursorStyles {\n\t\tcaption := func(m locales.Messages) string { return m.CmdCursorStyle(s.label(m)) }\n\t\tc = append(c, command{id: s.id(), caption: caption, run: func(a *app) {\n\t\t\ta.set.CursorStyle = s.name\n\t\t\ta.l.saveSettings()\n\t\t}})\n\t}\n\tfor _, s := range fileIconSets {\n\t\tcaption := func(m locales.Messages) string { return m.CmdFileIcons(s.label(m)) }\n\t\tc = append(c, command{id: s.id(), caption: caption, run: func(a *app) {\n\t\t\ta.set.FileIcons = s.name\n\t\t\ta.l.saveSettings()\n\t\t}})\n\t}\n\treturn slices.Concat(c, indentCommands(), lineEndingCommands(), encodingCommands())\n}\n\n// deleteBlankLines deletes the lines of white space alone from the lines\n// of the selections, a caret alone taking all lines, as the\n// DeleteBlankLines package does. With surplus it keeps the first line of\n// each run of them.\nfunc deleteBlankLines(st *editor.State, surplus bool) {\n\tt := st.Buffer.Snapshot()\n\ttype span struct{ from, to int }\n\tvar spans []span\n\tsels := st.Selections()\n\tif len(sels) == 1 \u0026\u0026 sels[0].Anchor == sels[0].Head {\n\t\tspans = []span{{0, t.LineCount() - 1}}\n\t} else {\n\t\tfor _, s := range sels {\n\t\t\ta, z := min(s.Anchor, s.Head), max(s.Anchor, s.Head)\n\t\t\tsp := span{t.LineOf(a), t.LineOf(z)}\n\t\t\tif sp.to \u003e sp.from \u0026\u0026 z == t.LineStart(sp.to) {\n\t\t\t\tsp.to--\n\t\t\t}\n\t\t\tif n := len(spans); n \u003e 0 \u0026\u0026 sp.from \u003c= spans[n-1].to {\n\t\t\t\tspans[n-1].to = max(spans[n-1].to, sp.to)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tspans = append(spans, sp)\n\t\t}\n\t}\n\tlast := t.LineCount() - 1\n\tvar edits []editor.Edit\n\tfor _, sp := range spans {\n\t\trun := false\n\t\tfor i := sp.from; i \u003c= sp.to; i++ {\n\t\t\tblank := strings.TrimSpace(t.Line(i)) == \"\"\n\t\t\tkeep := !blank || surplus \u0026\u0026 !run\n\t\t\trun = blank\n\t\t\tswitch {\n\t\t\tcase keep:\n\t\t\tcase i \u003c last:\n\t\t\t\tedits = append(edits, editor.Edit{Start: t.LineStart(i), End: t.LineStart(i + 1)})\n\t\t\tdefault:\n\t\t\t\t// The last line loses its white space only, so the file keeps\n\t\t\t\t// its final newline.\n\t\t\t\tedits = append(edits, editor.Edit{Start: t.LineStart(i), End: t.LineEnd(i)})\n\t\t\t}\n\t\t}\n\t}\n\tst.Buffer.Edit(edits...)\n}\n\n// caseSpans readies the selections for convert, which converts the case\n// of each, as Sublime Text's CaseConversion package does: a caret takes\n// its word, trim leaves out the white space around a selection, and those\n// that overlap merge, so that MyGo converts a word once. A caret in no\n// word, or a selection of white space alone, stays out of convert's\n// reach, as MyGo would take the white space or punctuation around it, and\n// drop it from a name.\nfunc caseSpans(st *editor.State, trim bool, convert func()) {\n\tt := st.Buffer.Snapshot()\n\tchars := wordChars(st.Buffer)\n\tvar spans, rest []editor.Selection\n\tfor _, s := range st.Selections() {\n\t\ta, z := min(s.Anchor, s.Head), max(s.Anchor, s.Head)\n\t\tswitch {\n\t\tcase a == z:\n\t\t\tline := t.LineOf(a)\n\t\t\tstart, text := t.LineStart(line), t.Line(line)\n\t\t\ta, z = start+wordStart(text, a-start, chars), start+wordEnd(text, a-start, chars)\n\t\tcase trim:\n\t\t\ttext := t.Slice(a, z)\n\t\t\tz = a + len(strings.TrimRightFunc(text, unicode.IsSpace))\n\t\t\ta += len(text) - len(strings.TrimLeftFunc(text, unicode.IsSpace))\n\t\t}\n\t\tif a \u003e= z {\n\t\t\trest = append(rest, s)\n\t\t} else {\n\t\t\tspans = append(spans, editor.Selection{Anchor: a, Head: z})\n\t\t}\n\t}\n\tif len(spans) == 0 {\n\t\treturn\n\t}\n\tst.SetSelections(spans...)\n\tbefore := st.Selections()\n\tconvert()\n\tafter := st.Selections()\n\t// A name converted to nothing merges with the selection it touches.\n\tif len(rest) == 0 || len(after) != len(before) {\n\t\treturn\n\t}\n\tsize := func(s editor.Selection) int { return max(s.Anchor, s.Head) - min(s.Anchor, s.Head) }\n\tshift, i := 0, 0\n\tfor k, r := range rest {\n\t\tfor ; i \u003c len(before) \u0026\u0026 max(before[i].Anchor, before[i].Head) \u003c= min(r.Anchor, r.Head); i++ {\n\t\t\tshift += size(after[i]) - size(before[i])\n\t\t}\n\t\trest[k] = editor.Selection{Anchor: r.Anchor + shift, Head: r.Head + shift}\n\t}\n\tst.SetSelections(append(rest, after...)...)\n}\n\n// swapCase swaps the case of each selection, as Sublime Text's swap_case\n// does, and selects what it swapped, as the editor's upper_case does.\nfunc swapCase(st *editor.State) {\n\tt := st.Buffer.Snapshot()\n\tvar edits []editor.Edit\n\tvar sels []editor.Selection\n\tdelta := 0\n\tfor _, s := range st.Selections() {\n\t\ta, z := min(s.Anchor, s.Head), max(s.Anchor, s.Head)\n\t\told := t.Slice(a, z)\n\t\tswapped := strings.Map(func(r rune) rune {\n\t\t\tif unicode.IsUpper(r) {\n\t\t\t\treturn unicode.ToLower(r)\n\t\t\t}\n\t\t\treturn unicode.ToUpper(r)\n\t\t}, old)\n\t\tedits = append(edits, editor.Edit{Start: a, End: z, Text: swapped})\n\t\tsels = append(sels, editor.Selection{Anchor: a + delta, Head: a + delta + len(swapped)})\n\t\tdelta += len(swapped) - len(old)\n\t}\n\tst.Buffer.Edit(edits...)\n\tst.SetSelections(sels...)\n}\n\n// formatJSON indents, or with minify compacts, the JSON of each selection,\n// or of all the text when nothing is selected. When one does not parse,\n// none changes: the caret goes where it fails, which the status bar tells.\nfunc (a *app) formatJSON(st *editor.State, minify bool) {\n\tt := st.Buffer.Snapshot()\n\tvar spans [][2]int\n\tfor _, s := range st.Selections() {\n\t\tif s.Anchor != s.Head {\n\t\t\tspans = append(spans, [2]int{min(s.Anchor, s.Head), max(s.Anchor, s.Head)})\n\t\t}\n\t}\n\twhole := len(spans) == 0\n\tif whole {\n\t\tspans = [][2]int{{0, t.Len()}}\n\t}\n\tunit := indentUnit(st)\n\tvar edits []editor.Edit\n\tvar sels []editor.Selection\n\tdelta := 0\n\tfor _, sp := range spans {\n\t\t// The white space around the JSON stays, as a file's final newline.\n\t\tsrc := t.Slice(sp[0], sp[1])\n\t\ttrimmed := strings.TrimLeftFunc(src, unicode.IsSpace)\n\t\tlead := len(src) - len(trimmed)\n\t\tsrc = strings.TrimRightFunc(trimmed, unicode.IsSpace)\n\t\tat := sp[0] + lead\n\t\tvar out bytes.Buffer\n\t\tvar err error\n\t\tif minify {\n\t\t\terr = json.Compact(\u0026out, []byte(src))\n\t\t} else {\n\t\t\tline := t.Line(t.LineOf(at))\n\t\t\terr = json.Indent(\u0026out, []byte(src), line[:len(line)-len(strings.TrimLeft(line, \" \\t\"))], unit)\n\t\t}\n\t\tif err != nil {\n\t\t\ta.jsonError(st, at, src, err)\n\t\t\treturn\n\t\t}\n\t\tedits = append(edits, editor.Edit{Start: at, End: at + len(src), Text: out.String()})\n\t\tsels = append(sels, editor.Selection{Anchor: at + delta, Head: at + delta + out.Len()})\n\t\tdelta += out.Len() - len(src)\n\t}\n\tst.Buffer.Edit(edits...)\n\tif !whole {\n\t\tst.SetSelections(sels...)\n\t}\n}\n\nfunc (a *app) jsonError(st *editor.State, at int, src string, err error) {\n\tvar se *json.SyntaxError\n\tif !errors.As(err, \u0026se) {\n\t\treturn\n\t}\n\t// The scanner's messages name the character it stopped at so:\n\t// \"invalid character '}' looking for beginning of object key string\".\n\tif rest, ok := strings.CutPrefix(se.Error(), \"invalid character \"); ok {\n\t\tif i := strings.Index(rest, \"' \"); i \u003e 0 {\n\t\t\trest = rest[:i]\n\t\t}\n\t\tpos := at + max(int(se.Offset)-1, 0)\n\t\tst.Select(pos, pos)\n\t\ta.notifyError(locales.StatusInvalidJSON(strings.Trim(rest, \"'\")))\n\t\treturn\n\t}\n\tst.Select(at+len(src), at+len(src))\n\ta.notifyError(locales.StatusIncompleteJSON())\n}\n\n// indentUnit is what a level of indentation inserts in st, chosen as its\n// editor chooses it, which keeps that to itself.\nfunc indentUnit(st *editor.State) string {\n\tl := st.Buffer.Language()\n\tif st.Indent == editor.IndentTabs || st.Indent == editor.IndentAuto \u0026\u0026 l != nil \u0026\u0026 l.HardTabs {\n\t\treturn \"\\t\"\n\t}\n\tsize := st.TabSize\n\tif size \u003c= 0 {\n\t\tsize = 4\n\t\tif l != nil \u0026\u0026 l.TabSize \u003e 0 {\n\t\t\tsize = l.TabSize\n\t\t}\n\t}\n\treturn strings.Repeat(\" \", size)\n}\n\nfunc (a *app) run(id string) {\n\tif c := commandByID[id]; c != nil {\n\t\tc.run(a)\n\t}\n}\n","package main\n\nimport (\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/egoist/mygo/ui\"\n\t\"github.com/egoist/mygo/ui/editor\"\n)\n\nvar mac = runtime.GOOS == \"darwin\"\n\n// editorKeys are the editor's keys, as Sublime Text's keymap of this\n// platform has them; every other key the editor would bind by default\n// is taken away from it.\nvar editorKeys = sublimeOnly(func() []editor.Binding {\n\tif mac {\n\t\treturn macEditorKeys()\n\t}\n\treturn pcEditorKeys(runtime.GOOS == \"windows\")\n}())\n\nfunc bind(mods ui.Modifiers, key ui.Key, cmd editor.Command) editor.Binding {\n\treturn editor.Binding{Mods: mods, Key: key, Command: cmd}\n}\n\nfunc macEditorKeys() []editor.Binding {\n\tcmd, alt, ctrl, sh := ui.Super, ui.Alt, ui.Ctrl, ui.Shift\n\treturn []editor.Binding{\n\t\t// The text keys of macOS, which Sublime Text leaves to the system.\n\t\tbind(0, ui.KeyLeft, editor.MoveLeft), bind(0, ui.KeyRight, editor.MoveRight),\n\t\tbind(0, ui.KeyUp, editor.MoveUp), bind(0, ui.KeyDown, editor.MoveDown),\n\t\tbind(sh, ui.KeyLeft, editor.SelectLeft), bind(sh, ui.KeyRight, editor.SelectRight),\n\t\tbind(sh, ui.KeyUp, editor.SelectUp), bind(sh, ui.KeyDown, editor.SelectDown),\n\t\tbind(ctrl, ui.KeyB, editor.MoveLeft), bind(ctrl, ui.KeyF, editor.MoveRight),\n\t\tbind(ctrl, ui.KeyP, editor.MoveUp), bind(ctrl, ui.KeyN, editor.MoveDown),\n\t\tbind(alt, ui.KeyLeft, editor.MoveWordLeft), bind(alt, ui.KeyRight, editor.MoveWordRight),\n\t\tbind(alt|sh, ui.KeyLeft, editor.SelectWordLeft), bind(alt|sh, ui.KeyRight, editor.SelectWordRight),\n\t\tbind(alt, ui.KeyUp, editor.MoveParagraphUp), bind(alt, ui.KeyDown, editor.MoveParagraphDown),\n\t\tbind(alt|sh, ui.KeyUp, editor.SelectParagraphUp), bind(alt|sh, ui.KeyDown, editor.SelectParagraphDown),\n\t\tbind(cmd, ui.KeyLeft, editor.MoveLineStart), bind(cmd, ui.KeyRight, editor.MoveLineEnd),\n\t\tbind(cmd|sh, ui.KeyLeft, editor.SelectLineStart), bind(cmd|sh, ui.KeyRight, editor.SelectLineEnd),\n\t\tbind(ctrl, ui.KeyA, editor.MoveLineStart), bind(ctrl, ui.KeyE, editor.MoveLineEnd),\n\t\tbind(cmd, ui.KeyUp, editor.MoveDocStart), bind(cmd, ui.KeyDown, editor.MoveDocEnd),\n\t\tbind(cmd|sh, ui.KeyUp, editor.SelectDocStart), bind(cmd|sh, ui.KeyDown, editor.SelectDocEnd),\n\t\tbind(0, ui.KeyHome, editor.MoveDocStart), bind(0, ui.KeyEnd, editor.MoveDocEnd),\n\t\tbind(sh, ui.KeyHome, editor.SelectDocStart), bind(sh, ui.KeyEnd, editor.SelectDocEnd),\n\t\tbind(0, ui.KeyPageUp, editor.MovePageUp), bind(0, ui.KeyPageDown, editor.MovePageDown),\n\t\tbind(sh, ui.KeyPageUp, editor.SelectPageUp), bind(sh, ui.KeyPageDown, editor.SelectPageDown),\n\t\tbind(0, ui.KeyBackspace, editor.Backspace), bind(sh, ui.KeyBackspace, editor.Backspace),\n\t\tbind(ctrl, ui.KeyH, editor.Backspace), bind(0, ui.KeyDelete, editor.Delete), bind(ctrl, ui.KeyD, editor.Delete),\n\t\tbind(alt, ui.KeyBackspace, editor.DeleteWordLeft), bind(alt, ui.KeyDelete, editor.DeleteWordRight),\n\t\tbind(0, ui.KeyEnter, editor.Newline), bind(sh, ui.KeyEnter, editor.Newline),\n\t\tbind(0, ui.KeyTab, editor.Tab), bind(sh, ui.KeyTab, editor.Backtab), bind(0, ui.KeyEscape, editor.Cancel),\n\n\t\tbind(ctrl, ui.KeyLeft, editor.MoveSubwordLeft), bind(ctrl, ui.KeyRight, editor.MoveSubwordRight),\n\t\tbind(ctrl|sh, ui.KeyLeft, editor.SelectSubwordLeft), bind(ctrl|sh, ui.KeyRight, editor.SelectSubwordRight),\n\t\tbind(ctrl|alt, ui.KeyLeft, editor.MoveSubwordLeft), bind(ctrl|alt, ui.KeyRight, editor.MoveSubwordRight),\n\t\tbind(ctrl|alt|sh, ui.KeyLeft, editor.SelectSubwordLeft), bind(ctrl|alt|sh, ui.KeyRight, editor.SelectSubwordRight),\n\t\tbind(ctrl|alt, ui.KeyUp, editor.ScrollLineUp), bind(ctrl|alt, ui.KeyDown, editor.ScrollLineDown),\n\t\tbind(ctrl|sh, ui.KeyUp, editor.AddCursorAbove), bind(ctrl|sh, ui.KeyDown, editor.AddCursorBelow),\n\t\tbind(cmd, ui.KeyZ, editor.Undo), bind(cmd|sh, ui.KeyZ, editor.Redo), bind(cmd, ui.KeyY, editor.Redo),\n\t\tbind(cmd, ui.KeyU, editor.UndoSelection), bind(cmd|sh, ui.KeyU, editor.RedoSelection),\n\t\tbind(cmd, ui.KeyX, editor.Cut), bind(cmd, ui.KeyC, editor.Copy),\n\t\tbind(cmd, ui.KeyV, editor.Paste), bind(cmd|sh, ui.KeyV, editor.Paste),\n\t\tbind(cmd, ui.KeyA, editor.SelectAll), bind(cmd|sh, ui.KeyL, editor.SplitSelectionIntoLines),\n\t\tbind(cmd, ui.KeyL, editor.SelectLine),\n\t\tbind(cmd|sh, ui.KeySpace, editor.SelectLarger), bind(cmd|sh, ui.KeyA, editor.SelectLarger),\n\t\tbind(ctrl|sh, ui.KeyM, editor.SelectLarger), bind(ctrl, ui.KeyM, editor.MoveToBracket),\n\t\tbind(cmd, ui.KeyBracketRight, editor.Indent), bind(cmd, ui.KeyBracketLeft, editor.Outdent),\n\t\tbind(cmd, ui.KeyEnter, editor.NewlineBelow), bind(cmd|sh, ui.KeyEnter, editor.NewlineAbove),\n\t\tbind(0, ui.KeyF12, editor.GoToDefinition), bind(cmd|alt, ui.KeyDown, editor.GoToDefinition),\n\t\tbind(ctrl, ui.KeySpace, editor.ShowCompletions),\n\t\tbind(ctrl, ui.KeyPeriod, editor.NextHunk), bind(ctrl, ui.KeyComma, editor.PreviousHunk),\n\t\tbind(ctrl|cmd, ui.KeyUp, editor.MoveLinesUp), bind(ctrl|cmd, ui.KeyDown, editor.MoveLinesDown),\n\t\tbind(ctrl, ui.KeyBackspace, editor.DeleteSubwordLeft), bind(ctrl, ui.KeyDelete, editor.DeleteSubwordRight),\n\t\tbind(cmd, ui.KeyBackspace, editor.DeleteToLineStart), bind(cmd, ui.KeyDelete, editor.DeleteToLineEnd),\n\t\tbind(ctrl, ui.KeyK, editor.DeleteToLineEnd), bind(ctrl|sh, ui.KeyK, editor.DeleteLine),\n\t\tbind(cmd, ui.KeySlash, editor.ToggleComment), bind(cmd|alt, ui.KeySlash, editor.ToggleBlockComment),\n\t\tbind(cmd|sh, ui.KeyJ, editor.JoinLines), bind(cmd|sh, ui.KeyD, editor.DuplicateSelection),\n\t\tbind(ctrl, ui.KeyT, editor.Transpose), bind(ctrl, ui.KeyL, editor.ScrollCursorCenter),\n\t\tbind(0, ui.KeyF5, editor.SortLinesCaseInsensitive), bind(ctrl, ui.KeyF5, editor.SortLines),\n\t\tbind(cmd|alt, ui.KeyBracketLeft, editor.Fold), bind(cmd|alt, ui.KeyBracketRight, editor.Unfold),\n\t}\n}\n\nfunc pcEditorKeys(windows bool) []editor.Binding {\n\talt, ctrl, sh := ui.Alt, ui.Ctrl, ui.Shift\n\t// Linux leaves Ctrl+Alt+arrows to the desktop's workspaces.\n\taddCursor := alt | sh\n\tif windows {\n\t\taddCursor = ctrl | alt\n\t}\n\treturn []editor.Binding{\n\t\tbind(0, ui.KeyLeft, editor.MoveLeft), bind(0, ui.KeyRight, editor.MoveRight),\n\t\tbind(0, ui.KeyUp, editor.MoveUp), bind(0, ui.KeyDown, editor.MoveDown),\n\t\tbind(sh, ui.KeyLeft, editor.SelectLeft), bind(sh, ui.KeyRight, editor.SelectRight),\n\t\tbind(sh, ui.KeyUp, editor.SelectUp), bind(sh, ui.KeyDown, editor.SelectDown),\n\t\tbind(ctrl, ui.KeyLeft, editor.MoveWordLeft), bind(ctrl, ui.KeyRight, editor.MoveWordRight),\n\t\tbind(ctrl|sh, ui.KeyLeft, editor.SelectWordLeft), bind(ctrl|sh, ui.KeyRight, editor.SelectWordRight),\n\t\tbind(alt, ui.KeyLeft, editor.MoveSubwordLeft), bind(alt, ui.KeyRight, editor.MoveSubwordRight),\n\t\tbind(alt|sh, ui.KeyLeft, editor.SelectSubwordLeft), bind(alt|sh, ui.KeyRight, editor.SelectSubwordRight),\n\t\tbind(addCursor, ui.KeyUp, editor.AddCursorAbove), bind(addCursor, ui.KeyDown, editor.AddCursorBelow),\n\t\tbind(0, ui.KeyPageUp, editor.MovePageUp), bind(0, ui.KeyPageDown, editor.MovePageDown),\n\t\tbind(sh, ui.KeyPageUp, editor.SelectPageUp), bind(sh, ui.KeyPageDown, editor.SelectPageDown),\n\t\tbind(0, ui.KeyHome, editor.MoveLineStart), bind(0, ui.KeyEnd, editor.MoveLineEnd),\n\t\tbind(sh, ui.KeyHome, editor.SelectLineStart), bind(sh, ui.KeyEnd, editor.SelectLineEnd),\n\t\tbind(ctrl, ui.KeyHome, editor.MoveDocStart), bind(ctrl, ui.KeyEnd, editor.MoveDocEnd),\n\t\tbind(ctrl|sh, ui.KeyHome, editor.SelectDocStart), bind(ctrl|sh, ui.KeyEnd, editor.SelectDocEnd),\n\t\tbind(ctrl, ui.KeyUp, editor.ScrollLineUp), bind(ctrl, ui.KeyDown, editor.ScrollLineDown),\n\t\tbind(0, ui.KeyBackspace, editor.Backspace), bind(sh, ui.KeyBackspace, editor.Backspace),\n\t\tbind(0, ui.KeyDelete, editor.Delete),\n\t\tbind(0, ui.KeyEnter, editor.Newline), bind(sh, ui.KeyEnter, editor.Newline),\n\t\tbind(ctrl, ui.KeyEnter, editor.NewlineBelow), bind(ctrl|sh, ui.KeyEnter, editor.NewlineAbove),\n\t\tbind(ctrl, ui.KeyZ, editor.Undo), bind(ctrl|sh, ui.KeyZ, editor.Redo), bind(ctrl, ui.KeyY, editor.Redo),\n\t\tbind(ctrl, ui.KeyU, editor.UndoSelection), bind(ctrl|sh, ui.KeyU, editor.RedoSelection),\n\t\tbind(sh, ui.KeyDelete, editor.Cut), bind(ctrl, ui.KeyInsert, editor.Copy), bind(sh, ui.KeyInsert, editor.Paste),\n\t\tbind(ctrl, ui.KeyX, editor.Cut), bind(ctrl, ui.KeyC, editor.Copy),\n\t\tbind(ctrl, ui.KeyV, editor.Paste), bind(ctrl|sh, ui.KeyV, editor.Paste),\n\t\tbind(ctrl, ui.KeyA, editor.SelectAll), bind(ctrl|sh, ui.KeyL, editor.SplitSelectionIntoLines),\n\t\tbind(0, ui.KeyEscape, editor.Cancel), bind(0, ui.KeyTab, editor.Tab), bind(sh, ui.KeyTab, editor.Backtab),\n\t\tbind(ctrl, ui.KeyBracketRight, editor.Indent), bind(ctrl, ui.KeyBracketLeft, editor.Outdent),\n\t\tbind(ctrl, ui.KeyL, editor.SelectLine),\n\t\tbind(ctrl|sh, ui.KeySpace, editor.SelectLarger), bind(ctrl|sh, ui.KeyA, editor.SelectLarger),\n\t\tbind(ctrl|sh, ui.KeyM, editor.SelectLarger), bind(ctrl, ui.KeyM, editor.MoveToBracket),\n\t\tbind(0, ui.KeyF12, editor.GoToDefinition), bind(ctrl, ui.KeySpace, editor.ShowCompletions),\n\t\t// Ctrl+, opens Settings on non-macOS, so hunk navigation moves to Alt.\n\t\tbind(alt, ui.KeyPeriod, editor.NextHunk), bind(alt, ui.KeyComma, editor.PreviousHunk),\n\t\tbind(ctrl|sh, ui.KeyUp, editor.MoveLinesUp), bind(ctrl|sh, ui.KeyDown, editor.MoveLinesDown),\n\t\tbind(ctrl, ui.KeyBackspace, editor.DeleteWordLeft), bind(ctrl, ui.KeyDelete, editor.DeleteWordRight),\n\t\tbind(ctrl|sh, ui.KeyBackspace, editor.DeleteToLineStart), bind(ctrl|sh, ui.KeyDelete, editor.DeleteToLineEnd),\n\t\tbind(ctrl|sh, ui.KeyK, editor.DeleteLine),\n\t\tbind(ctrl, ui.KeySlash, editor.ToggleComment), bind(ctrl|sh, ui.KeySlash, editor.ToggleBlockComment),\n\t\tbind(ctrl|sh, ui.KeyJ, editor.JoinLines), bind(ctrl|sh, ui.KeyD, editor.DuplicateSelection),\n\t\tbind(ctrl, ui.KeyT, editor.Transpose),\n\t\tbind(0, ui.KeyF9, editor.SortLinesCaseInsensitive), bind(ctrl, ui.KeyF9, editor.SortLines),\n\t\tbind(ctrl|sh, ui.KeyBracketLeft, editor.Fold), bind(ctrl|sh, ui.KeyBracketRight, editor.Unfold),\n\t}\n}\n\n// sublimeOnly adds to keys a binding to NoCommand for each key the editor\n// binds by default and keys leave out. The chords are left: their first\n// key, Cmd+K, goes to the window.\nfunc sublimeOnly(keys []editor.Binding) []editor.Binding {\n\ttype key struct {\n\t\tmods ui.Modifiers\n\t\tkey  ui.Key\n\t}\n\thave := make(map[key]bool)\n\tfor _, b := range keys {\n\t\thave[key{b.Mods, b.Key}] = true\n\t}\n\tfor _, b := range editor.DefaultBindings() {\n\t\tif k := (key{b.Mods, b.Key}); b.ThenKey == 0 \u0026\u0026 !have[k] {\n\t\t\thave[k] = true\n\t\t\tkeys = append(keys, bind(b.Mods, b.Key, editor.NoCommand))\n\t\t}\n\t}\n\treturn keys\n}\n\n// appKey is a key of the command named id: mods+key, or the chord Cmd+K\n// then mods+key when chord is set.\ntype appKey struct {\n\tmods  ui.Modifiers\n\tkey   ui.Key\n\tchord bool\n\tid    string\n}\n\nvar appKeys = func() []appKey {\n\tcmd, alt, ctrl, sh := ui.Cmd, ui.Alt, ui.Ctrl, ui.Shift\n\tk := func(mods ui.Modifiers, key ui.Key, id string) appKey { return appKey{mods, key, false, id} }\n\tch := func(mods ui.Modifiers, key ui.Key, id string) appKey { return appKey{cmd | mods, key, true, id} }\n\tkeys := []appKey{\n\t\tk(cmd, ui.KeyN, \"new_file\"), k(cmd|sh, ui.KeyN, \"new_window\"), k(cmd, ui.KeyO, \"prompt_open\"), k(cmd|sh, ui.KeyT, \"reopen_last_file\"),\n\t\tk(cmd, ui.KeyS, \"save\"), k(cmd|sh, ui.KeyS, \"prompt_save_as\"),\n\t\tk(cmd, ui.KeyW, \"close\"), k(cmd|sh, ui.KeyW, \"close_window\"),\n\t\tk(cmd, ui.KeyP, \"show_goto\"), k(cmd|sh, ui.KeyP, \"show_command_palette\"), k(ctrl, ui.KeyG, \"goto_line\"),\n\t\tk(cmd, ui.KeyR, \"goto_symbol\"),\n\t\tk(ctrl, ui.KeyPageUp, \"prev_view\"), k(ctrl, ui.KeyPageDown, \"next_view\"),\n\t\tk(ctrl, ui.KeyTab, \"next_view_in_stack\"), k(ctrl|sh, ui.KeyTab, \"prev_view_in_stack\"),\n\t\tk(cmd, ui.KeyEqual, \"increase_font_size\"), k(cmd|sh, ui.KeyEqual, \"increase_font_size\"),\n\t\tk(cmd, ui.KeyMinus, \"decrease_font_size\"),\n\t\tk(cmd, ui.KeyF, \"show_panel find\"), k(cmd, ui.KeyI, \"show_panel find\"), k(cmd|sh, ui.KeyI, \"show_panel find\"),\n\t\tk(cmd, ui.KeyE, \"slurp_find_string\"), k(cmd, ui.KeyD, \"find_under_expand\"),\n\t\tk(cmd|sh, ui.KeyF, \"show_panel find_in_files\"), k(0, ui.KeyF4, \"next_result\"), k(sh, ui.KeyF4, \"prev_result\"),\n\t\tk(cmd, ui.KeyComma, \"show_settings\"),\n\t\tk(cmd, ui.KeyB, \"toggle_side_bar\"),\n\t\t// Zed's keys, which Sublime Text has no panels for.\n\t\tk(cmd|sh, ui.KeyE, \"toggle_files_panel\"), k(ctrl|sh, ui.KeyG, \"toggle_git_panel\"),\n\n\t\tch(0, ui.KeyB, \"toggle_side_bar\"),\n\t\tch(0, ui.KeyU, \"upper_case\"), ch(0, ui.KeyL, \"lower_case\"), ch(0, ui.KeyD, \"find_under_expand_skip\"),\n\t\tch(0, ui.KeyK, \"delete_to_eol\"), ch(0, ui.KeyBackspace, \"delete_to_bol\"), ch(0, ui.KeyC, \"show_at_center\"),\n\t\tch(0, ui.Key0, \"unfold_all\"), ch(0, ui.KeyJ, \"unfold_all\"), ch(0, ui.KeyZ, \"revert_hunk\"),\n\t\tch(0, ui.KeyUp, \"new_pane\"), ch(0, ui.KeyDown, \"close_pane\"),\n\t\tch(0, ui.KeyLeft, \"focus_prev_group\"), ch(0, ui.KeyRight, \"focus_next_group\"),\n\t\tch(sh, ui.KeyLeft, \"move_to_prev_group\"), ch(sh, ui.KeyRight, \"move_to_next_group\"),\n\t\t// Zed's Cmd+K V, which Sublime Text has no preview for. Its Cmd+K\n\t\t// Cmd+V pastes from the history.\n\t\t{key: ui.KeyV, chord: true, id: \"open_markdown_preview_to_the_side\"},\n\t}\n\tfor i := range 9 {\n\t\tkeys = append(keys, ch(0, ui.Key1+ui.Key(i), foldLevel(i+1)))\n\t}\n\tfor i := range 4 {\n\t\tkeys = append(keys, k(ctrl, ui.Key1+ui.Key(i), focusGroup(i)), k(ctrl|sh, ui.Key1+ui.Key(i), moveToGroup(i)))\n\t}\n\ttabs, layout := cmd, cmd|alt\n\tif !mac {\n\t\ttabs, layout = alt, alt|sh\n\t}\n\tfor i := range 8 {\n\t\tkeys = append(keys, k(tabs, ui.Key1+ui.Key(i), selectTab(i)))\n\t}\n\tkeys = append(keys, k(tabs, ui.Key9, \"select_last_tab\"))\n\tfor i, l := range layouts {\n\t\tkey := ui.Key1 + ui.Key(i)\n\t\tif l.rows \u003e 1 \u0026\u0026 l.cols == 1 {\n\t\t\tkey = ui.Key2 + ui.Key(l.rows-2)\n\t\t\tif mac {\n\t\t\t\tkeys = append(keys, k(layout|sh, key, l.id()))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkey = ui.Key8 + ui.Key(l.rows-2)\n\t\t}\n\t\tkeys = append(keys, k(layout, key, l.id()))\n\t}\n\tjump := ctrl\n\tif !mac {\n\t\tjump = alt\n\t}\n\tkeys = append(keys, k(jump, ui.KeyMinus, \"jump_back\"), k(jump|sh, ui.KeyMinus, \"jump_forward\"))\n\tif mac {\n\t\tkeys = append(keys, k(cmd|alt, ui.KeyF, \"show_panel replace\"), k(cmd, ui.KeyG, \"find_next\"), k(cmd|sh, ui.KeyG, \"find_prev\"),\n\t\t\tk(ctrl|cmd, ui.KeyG, \"find_all_under\"), k(cmd, ui.KeyT, \"show_goto\"), k(cmd|alt, ui.KeyS, \"save_all\"),\n\t\t\tk(cmd|sh, ui.KeyBracketLeft, \"prev_view\"), k(cmd|sh, ui.KeyBracketRight, \"next_view\"),\n\t\t\tk(cmd|alt, ui.KeyLeft, \"prev_view\"), k(cmd|alt, ui.KeyRight, \"next_view\"),\n\t\t\tk(ctrl|cmd, ui.KeyP, \"prompt_select_workspace\"))\n\t} else {\n\t\tkeys = append(keys, k(ctrl, ui.KeyH, \"show_panel replace\"), k(0, ui.KeyF3, \"find_next\"), k(sh, ui.KeyF3, \"find_prev\"),\n\t\t\tk(alt, ui.KeyF3, \"find_all_under\"), k(ctrl, ui.KeyF4, \"close\"),\n\t\t\tk(ctrl|alt, ui.KeyP, \"prompt_select_workspace\"))\n\t}\n\treturn keys\n}()\n\nvar keyNames = map[ui.Key][2]string{\n\tui.KeyLeft: {\"Left\", \"←\"}, ui.KeyRight: {\"Right\", \"→\"}, ui.KeyUp: {\"Up\", \"↑\"}, ui.KeyDown: {\"Down\", \"↓\"},\n\tui.KeyPageUp: {\"PageUp\", \"⇞\"}, ui.KeyPageDown: {\"PageDown\", \"⇟\"}, ui.KeyHome: {\"Home\", \"↖\"}, ui.KeyEnd: {\"End\", \"↘\"},\n\tui.KeyBackspace: {\"Backspace\", \"⌫\"}, ui.KeyDelete: {\"Delete\", \"⌦\"}, ui.KeyEnter: {\"Enter\", \"↩\"},\n\tui.KeyTab: {\"Tab\", \"⇥\"}, ui.KeyEscape: {\"Escape\", \"⎋\"}, ui.KeySpace: {\"Space\", \"Space\"}, ui.KeyInsert: {\"Insert\", \"Insert\"},\n\tui.KeyMinus: {\"-\", \"-\"}, ui.KeyEqual: {\"=\", \"=\"}, ui.KeyComma: {\",\", \",\"}, ui.KeyPeriod: {\".\", \".\"},\n\tui.KeySlash: {\"/\", \"/\"}, ui.KeySemicolon: {\";\", \";\"}, ui.KeyQuote: {\"'\", \"'\"}, ui.KeyBackquote: {\"`\", \"`\"},\n\tui.KeyBracketLeft: {\"[\", \"[\"}, ui.KeyBracketRight: {\"]\", \"]\"}, ui.KeyBackslash: {\"\\\\\", \"\\\\\"},\n}\n\nfunc keyName(k ui.Key, symbol bool) string {\n\tswitch {\n\tcase k \u003e= ui.KeyA \u0026\u0026 k \u003c= ui.KeyZ:\n\t\treturn string(rune('A' + k - ui.KeyA))\n\tcase k \u003e= ui.Key0 \u0026\u0026 k \u003c= ui.Key9:\n\t\treturn string(rune('0' + k - ui.Key0))\n\tcase k \u003e= ui.KeyF1 \u0026\u0026 k \u003c= ui.KeyF12:\n\t\treturn \"F\" + strconv.Itoa(int(k-ui.KeyF1)+1)\n\t}\n\tn := keyNames[k]\n\tif symbol {\n\t\treturn n[1]\n\t}\n\treturn n[0]\n}\n\nfunc accelerator(mods ui.Modifiers, key ui.Key) string {\n\tvar b strings.Builder\n\tfor _, m := range []struct {\n\t\tmod  ui.Modifiers\n\t\tname string\n\t}{{ui.Super, \"Super+\"}, {ui.Ctrl, \"Ctrl+\"}, {ui.Alt, \"Alt+\"}, {ui.Shift, \"Shift+\"}} {\n\t\tif mods\u0026m.mod != 0 {\n\t\t\tb.WriteString(m.name)\n\t\t}\n\t}\n\treturn b.String() + keyName(key, false)\n}\n\nfunc shortcutText(mods ui.Modifiers, key ui.Key) string {\n\tif !mac {\n\t\treturn strings.ReplaceAll(accelerator(mods, key), \"Super+\", \"Win+\")\n\t}\n\tvar b strings.Builder\n\tfor _, m := range []struct {\n\t\tmod  ui.Modifiers\n\t\tname string\n\t}{{ui.Ctrl, \"⌃\"}, {ui.Alt, \"⌥\"}, {ui.Shift, \"⇧\"}, {ui.Super, \"⌘\"}} {\n\t\tif mods\u0026m.mod != 0 {\n\t\t\tb.WriteString(m.name)\n\t\t}\n\t}\n\treturn b.String() + keyName(key, true)\n}\n\nfunc (k appKey) String() string {\n\ts := shortcutText(k.mods, k.key)\n\tif k.chord {\n\t\ts = shortcutText(ui.Cmd, ui.KeyK) + \" \" + s\n\t}\n\treturn s\n}\n","package main\n\nimport (\n\t\"slices\"\n\t\"strings\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"github.com/egoist/mygo/ui\"\n\t\"github.com/egoist/mygo/ui/editor\"\n\n\t\"lime/locales\"\n)\n\n// finding is what Sublime Text's find panel keeps across the editors of\n// a window: the query, the replacement and the options of the panel last\n// used, which a panel opened in another editor starts with.\ntype finding struct {\n\tquery, replace             string\n\tcaseSens, wholeWord, regex bool\n\treplacing                  bool\n\tpending                    bool\n\tseen                       string\n\trowsAt                     time.Time\n}\n\n// showFind opens the find panel of the current editor, with the replace\n// row when replace is set. The query is the selection on one line, as in\n// Sublime Text, else the last one.\nfunc (a *app) showFind(replace bool) {\n\td := a.current()\n\tif d == nil {\n\t\treturn\n\t}\n\ts := \u0026a.find\n\ts.replacing, s.pending = replace, true\n\tif d.cmp != nil {\n\t\ted := diffActiveEditor(\u0026d.cmp.diff)\n\t\t*findQueryAt(ed) = \"\"\n\t\td.cmp.diff.Run(editor.UseSelectionForFind)\n\t\tif t := *findQueryAt(ed); t != \"\" \u0026\u0026 !strings.Contains(t, \"\\n\") {\n\t\t\ts.query = t\n\t\t\td.cmp.diff.Run(editor.Find)\n\t\t} else {\n\t\t\td.cmp.diff.Find(s.query)\n\t\t}\n\t\treturn\n\t}\n\td.st.Run(editor.Find)\n\tif t := selectionQuery(d.st); t != \"\" {\n\t\ts.query = t\n\t} else {\n\t\td.st.Find(s.query)\n\t}\n}\n\nfunc (a *app) syncFind(ed unsafe.Pointer) {\n\ts := \u0026a.find\n\tif *findQueryAt(ed) != s.query || *findCaseSensAt(ed) != s.caseSens ||\n\t\t*findWholeWordAt(ed) != s.wholeWord || *findRegexAt(ed) != s.regex {\n\t\t*findQueryAt(ed) = s.query\n\t\t*findCaseSensAt(ed) = s.caseSens\n\t\t*findWholeWordAt(ed) = s.wholeWord\n\t\t*findRegexAt(ed) = s.regex\n\t\t*findStaleAt(ed) = true\n\t}\n}\n\nfunc (a *app) findStep(cmd editor.Command) {\n\tswitch d := a.current(); {\n\tcase d == nil:\n\tcase d.cmp != nil:\n\t\ta.syncFind(diffActiveEditor(\u0026d.cmp.diff))\n\t\td.cmp.diff.Run(cmd)\n\tcase d.kind == textDoc:\n\t\ta.syncFind(unsafe.Add(unsafe.Pointer(d.st), editorOffset))\n\t\td.st.Run(cmd)\n\t}\n}\n\n// selectionQuery returns the text of the newest selection, when it is on\n// one line, as Sublime Text takes a query from the selections.\nfunc selectionQuery(st *editor.State) string {\n\ts := st.Selection()\n\tt := st.Buffer.Slice(min(s.Anchor, s.Head), max(s.Anchor, s.Head))\n\tif strings.Contains(t, \"\\n\") {\n\t\treturn \"\"\n\t}\n\treturn t\n}\n\n// quickFind makes a command of run, one of Sublime Text's commands that\n// find from the selections, as Quick Add Next: the newest selection it\n// leaves becomes the query of the find panels to come.\nfunc quickFind(run func(st *editor.State)) func(a *app) {\n\treturn withDoc(func(a *app, d *doc) {\n\t\trun(d.st)\n\t\tif t := selectionQuery(d.st); t != \"\" {\n\t\t\ta.find.query = t\n\t\t}\n\t})\n}\n\n// skipNext is Sublime's find_under_expand_skip: the newest selection\n// gives way to the next occurrence.\nfunc skipNext(st *editor.State) {\n\told := st.Selection()\n\tif old.Anchor == old.Head {\n\t\tst.Run(editor.SelectNext)\n\t\treturn\n\t}\n\tif !st.Run(editor.SelectNext) {\n\t\treturn\n\t}\n\tnext := st.Selection()\n\trest := slices.DeleteFunc(st.Selections(), func(s editor.Selection) bool { return s == old || s == next })\n\tst.SetSelections(append(rest, next)...)\n}\n\nconst (\n\tfindToggleW = 28\n\t// The status and the buttons share a width, which they give up to\n\t// findSlotMin in a narrow group before the query does.\n\tfindSlotW   = 84\n\tfindSlotMin = 48\n\tfindQueryW  = 120\n\n\tfindMotionTime = 200 * time.Millisecond\n)\n\n// The find panel fades in sliding up and out sliding down, and its replace\n// row opens and closes. Colors alone keeps the editor's resizing, as a\n// divider dragged, from animating them: Enter and Exit play regardless.\nvar (\n\tfindBarMotion = ui.ElementTransition{Duration: findMotionTime, Colors: true, Enter: \u0026ui.Motion{Y: 8}, Exit: \u0026ui.Motion{Y: 8}}\n\tfindRowMotion = ui.ElementTransition{Duration: findMotionTime, Colors: true, Enter: \u0026ui.Motion{Collapse: true}, Exit: \u0026ui.Motion{Collapse: true}}\n)\n\nfunc (a *app) findBar(c *ui.Context, bar ui.Element, f *editor.FindBar, d *doc) {\n\ts := \u0026a.find\n\tswitch {\n\tcase d != a.current() || d.cmp != nil \u0026\u0026 f.Query() != findQueryAt(diffActiveEditor(\u0026d.cmp.diff)):\n\t\t// A panel left open in another group keeps its own.\n\tcase s.pending:\n\t\ts.pending, s.seen = false, *f.Query()\n\t\t*f.Replacement() = s.replace\n\t\t*f.CaseSensitive(), *f.WholeWord(), *f.Regexp() = s.caseSens, s.wholeWord, s.regex\n\t\tif f.Replacing() != s.replacing {\n\t\t\ts.rowsAt = c.Now()\n\t\t}\n\t\tf.SetReplacing(s.replacing)\n\tdefault:\n\t\t// Only a query typed in the panel replaces the window's: Quick Add\n\t\t// Next sets that while the panel still shows another.\n\t\tif q := *f.Query(); q != s.seen {\n\t\t\ts.query, s.seen = q, q\n\t\t}\n\t\ts.replace = *f.Replacement()\n\t\ts.caseSens, s.wholeWord, s.regex = *f.CaseSensitive(), *f.WholeWord(), *f.Regexp()\n\t}\n\n\tsc, ch := a.scheme, a.scheme.chrome()\n\t// The editor places the bar over its top right corner: Attach moves it\n\t// to the bottom, and Top and Right take back the editor's offsets.\n\tbar.Attach(ui.AnchorBottomLeft, ui.AnchorBottomLeft).Top(0).Right(0).WidthPercent(100).\n\t\tGap(6).Padding(6, 8).Background(ch.bg).BorderWidth(1, 0, 0, 0).BorderColor(ch.line)\n\tmotion := findBarMotion\n\tif c.Now().Sub(s.rowsAt) \u003c findMotionTime {\n\t\t// Only the replace row showing or hiding grows and shrinks the panel.\n\t\tmotion.Position, motion.Size = true, true\n\t}\n\tbar.Transition(motion)\n\tfield := func(value *string, label string) ui.Element {\n\t\treturn ui.TextInputBase(c, value).Grow(1).MinWidth(findQueryW).Height(24).Padding(0, 8).Placeholder(label).Label(label).\n\t\t\tFontSize(13).Background(sc.bg).Border(1, ch.line).Radius(3)\n\t}\n\ttoggle := func(on *bool, label, tip string) {\n\t\tb := ui.ToggleBase(c, on).Width(findToggleW).Height(24).Center().Radius(3).Transition(colorFade).Label(tip).Tooltip(tip).KeepFocus()\n\t\tfg := ch.muted\n\t\tswitch {\n\t\tcase *on:\n\t\t\tb.Background(sc.accent.Alpha(0.25))\n\t\t\tfg = ch.text\n\t\tcase b.Hovered():\n\t\t\tb.Background(ch.hover)\n\t\t}\n\t\tb.Children(func() { ui.Text(c, label).FontSize(12).TextColor(fg) })\n\t}\n\tslot := func(e ui.Element) ui.Element { return e.Width(findSlotW).Shrink(1).MinWidth(findSlotMin) }\n\tbutton := func(label string, run func()) {\n\t\tb := slot(ui.ButtonBase(c)).Height(24).Center().Radius(3).Background(ch.panel).Border(1, ch.line).\n\t\t\tTransition(colorFade).Label(label).KeepFocus().OnClick(run)\n\t\tif b.Hovered() {\n\t\t\tb.Background(ch.hover)\n\t\t}\n\t\tb.Children(func() { ui.Text(c, label).FontSize(12).TextColor(ch.text).SingleLine().Ellipsis(\"…\") })\n\t}\n\tcloseBtn := func() {\n\t\tb := ui.ButtonBase(c).Width(24).Height(24).Shrink(0).Center().Radius(3).Transition(colorFade).\n\t\t\tLabel(locales.SettingsClose()).Tooltip(locales.SettingsClose()).KeepFocus().OnClick(f.Close)\n\t\tif b.Hovered() {\n\t\t\tb.Background(ch.hover)\n\t\t}\n\t\tb.Children(func() { ui.Text(c, \"×\").FontSize(14).TextColor(ch.muted) })\n\t}\n\trow := func(fill func()) ui.Element { return ui.Row(c).FillWidth().Gap(6).AlignItems(ui.Center).Children(fill) }\n\n\tbar.Children(func() {\n\t\trow(func() {\n\t\t\tui.Row(c).Gap(2).Shrink(0).Children(func() {\n\t\t\t\ttoggle(f.Regexp(), \".*\", locales.FindRegex())\n\t\t\t\ttoggle(f.CaseSensitive(), \"Aa\", locales.FindCaseSensitive())\n\t\t\t\ttoggle(f.WholeWord(), \"ab\", locales.FindWholeWord())\n\t\t\t\ttoggle(f.InSelection(), \"[ ]\", locales.FindInSelection())\n\t\t\t})\n\t\t\tf.QueryInput(field(f.Query(), locales.Find()))\n\t\t\tslot(ui.Text(c, f.Status())).FontSize(12).TextColor(ch.muted).FontFeatures(\"tnum\").\n\t\t\t\tSingleLine().Ellipsis(\"…\").Role(ui.RoleStatus)\n\t\t\tbutton(locales.Find(), f.Next)\n\t\t\tbutton(locales.FindPrevious(), f.Previous)\n\t\t\tbutton(locales.FindAll(), f.SelectAll)\n\t\t\tcloseBtn()\n\t\t})\n\t\tif f.Replacing() {\n\t\t\trow(func() {\n\t\t\t\tui.Box(c).Width(4*findToggleW + 3*2).Shrink(0)\n\t\t\t\tf.ReplacementInput(field(f.Replacement(), locales.Replace()))\n\t\t\t\tslot(ui.Box(c))\n\t\t\t\tbutton(locales.Replace(), f.Replace)\n\t\t\t\tbutton(locales.ReplaceAll(), f.ReplaceAll)\n\t\t\t\tslot(ui.Box(c))\n\t\t\t\tui.Box(c).Width(24).Shrink(0)\n\t\t\t}).Transition(findRowMotion)\n\t\t}\n\t})\n}\n","package main\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/egoist/mygo\"\n\t\"github.com/egoist/mygo/i18n\"\n\t\"github.com/egoist/mygo/ui\"\n\t\"github.com/egoist/mygo/ui/editor\"\n\n\t\"lime/locales\"\n)\n\ntype settings struct {\n\tLanguage          string     `json:\"language\"`\n\tAppearance        string     `json:\"appearance\"`\n\tLightTheme        string     `json:\"light_theme\"`\n\tDarkTheme         string     `json:\"dark_theme\"`\n\tUIFont            string     `json:\"ui_font\"`\n\tContentFont       string     `json:\"content_font\"`\n\tFontSize          float32    `json:\"font_size\"`\n\tWordWrap          bool       `json:\"word_wrap\"`\n\tSideBar           bool       `json:\"side_bar\"`\n\tSideBarWidth      float32    `json:\"side_bar_width\"`\n\tTabSize           int        `json:\"tab_size\"`\n\tRulers            rulers     `json:\"rulers\"`\n\tDrawWhiteSpace    whiteSpace `json:\"draw_white_space\"`\n\tLineNumbers       bool       `json:\"line_numbers\"`\n\tHighlightLine     bool       `json:\"highlight_line\"`\n\tDrawIndentGuides  bool       `json:\"draw_indent_guides\"`\n\tScrollPastEnd     pastEnd    `json:\"scroll_past_end\"`\n\tLayoutStyle       string     `json:\"layout_style\"`\n\tFileIcons         string     `json:\"file_icons\"`\n\tShowScrollBars    bool       `json:\"show_scroll_bars\"`\n\tCursorStyle       string     `json:\"cursor_style\"`\n\tTypingMode        string     `json:\"typing_mode\"`\n\tLinePaddingTop    float32    `json:\"line_padding_top\"`\n\tLinePaddingBottom float32    `json:\"line_padding_bottom\"`\n\t// FontOptions are Sublime Text's, of which the ligature ones count:\n\t// \"no_liga\", \"no_clig\" and \"no_calt\".\n\tFontOptions []string `json:\"font_options\"`\n\t// TranslateTabsToSpaces indents with spaces when true and tabs when\n\t// false; unset, as the language's files usually do.\n\tTranslateTabsToSpaces        *bool `json:\"translate_tabs_to_spaces,omitempty\"`\n\tTrimTrailingWhiteSpaceOnSave bool  `json:\"trim_trailing_white_space_on_save\"`\n\tEnsureNewlineAtEOFOnSave     bool  `json:\"ensure_newline_at_eof_on_save\"`\n\tAutoComplete                 bool  `json:\"auto_complete\"`\n\tDetectIndentation            bool  `json:\"detect_indentation\"`\n\t// FallbackEncoding is the name of the encoding a file that isn't\n\t// UTF-8 opens in, as Sublime Text's encodings are named.\n\tFallbackEncoding string `json:\"fallback_encoding\"`\n\tDiffUnified      bool   `json:\"diff_unified\"`\n\tGitTreeView      bool   `json:\"git_tree_view\"`\n\tGitDiffTarget    string `json:\"git_diff_target\"`\n\tInlineBlame      bool   `json:\"inline_blame\"`\n\t// FolderExcludePatterns and FileExcludePatterns override the default\n\t// side bar and indexing exclude patterns when set.\n\tFolderExcludePatterns []string `json:\"folder_exclude_patterns,omitzero\"`\n\tFileExcludePatterns   []string `json:\"file_exclude_patterns,omitzero\"`\n\t// Keys are the commands' keys the user changed, the one changed last\n\t// last.\n\tKeys []keyChange `json:\"keys,omitempty\"`\n\n\t// ColorScheme is the one scheme older settings named, which\n\t// loadSettings reads into Appearance and the themes.\n\tColorScheme string `json:\"color_scheme,omitempty\"`\n}\n\nconst (\n\tfollowSystem = \"system\"\n\tlightMode    = \"light\"\n\tdarkMode     = \"dark\"\n)\n\nconst defaultFontSize = 13\n\nfunc dataDir() string {\n\tdir, err := mygo.App.Path(mygo.PathUserData)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn dir\n}\n\nfunc settingsPath(dir string) string { return filepath.Join(dir, \"settings.json\") }\n\nfunc loadSettings(dir string) (settings, error) {\n\ts := settings{\n\t\tLanguage: followSystem, Appearance: followSystem, LightTheme: \"GitHub Light\", DarkTheme: \"GitHub Dark\",\n\t\tFontSize: defaultFontSize, WordWrap: true, SideBar: true, SideBarWidth: 220, LayoutStyle: compactLayout, FileIcons: fileIconsDefault, TabSize: 4, AutoComplete: true,\n\t\tGitDiffTarget: \"index\", DetectIndentation: true, FallbackEncoding: defaultFallback,\n\t\tRulers: rulers{}, DrawWhiteSpace: whiteSpace{\"selection\"}, LineNumbers: true, DrawIndentGuides: true,\n\t\tScrollPastEnd: true, FontOptions: []string{}, InlineBlame: true, CursorStyle: \"bar\",\n\t\tTypingMode: normalTyping,\n\t}\n\tvar err error\n\tif dir != \"\" {\n\t\tif b, rerr := os.ReadFile(settingsPath(dir)); rerr == nil {\n\t\t\terr = json.Unmarshal(b, \u0026s)\n\t\t}\n\t}\n\ts.migrate()\n\treturn s, err\n}\n\n// migrate reads the color scheme of older settings into the appearance\n// and the themes: \"Auto\" followed the system with GitHub's schemes, and\n// any other scheme showed whatever the system's appearance.\nfunc (s *settings) migrate() {\n\tname := s.ColorScheme\n\tif name == \"\" {\n\t\treturn\n\t}\n\ts.ColorScheme = \"\"\n\tswitch sc := schemeNamed(name); {\n\tcase sc == nil:\n\t\ts.Appearance = followSystem\n\tcase sc.dark:\n\t\ts.Appearance, s.DarkTheme = darkMode, name\n\tdefault:\n\t\ts.Appearance, s.LightTheme = lightMode, name\n\t}\n}\n\nfunc (s *settings) locale() string {\n\tif s.Language == followSystem {\n\t\treturn \"\"\n\t}\n\treturn i18n.Normalize(s.Language)\n}\n\nfunc (s *settings) layoutStyle() layoutStyle {\n\tfor _, l := range layoutStyles {\n\t\tif l.name == s.LayoutStyle {\n\t\t\treturn l\n\t\t}\n\t}\n\treturn layoutStyles[0]\n}\n\nfunc (s *settings) fileIcons() fileIconSet {\n\tfor _, f := range fileIconSets {\n\t\tif f.name == s.FileIcons {\n\t\t\treturn f\n\t\t}\n\t}\n\treturn fileIconSets[0]\n}\n\nfunc (s *settings) cursorStyle() cursorStyle {\n\tfor _, c := range cursorStyles {\n\t\tif c.name == s.CursorStyle {\n\t\t\treturn c\n\t\t}\n\t}\n\treturn cursorStyles[0]\n}\n\nconst (\n\tnormalTyping  = \"normal\"\n\trampageTyping = \"rampage\"\n)\n\nfunc (s *settings) rampage() bool { return s.TypingMode == rampageTyping }\n\nfunc (s *settings) indent() editor.IndentStyle { return indentStyle(s.TranslateTabsToSpaces) }\n\nfunc (s *settings) setIndent(style editor.IndentStyle) {\n\ts.TranslateTabsToSpaces = translateTabs(style)\n}\n\nfunc (s *settings) display(st *editor.State) {\n\tst.WrapGuides, st.Whitespace = s.Rulers, s.DrawWhiteSpace.mode()\n\tst.LineNumbers = editor.LineNumbersOn\n\tif !s.LineNumbers {\n\t\tst.LineNumbers = editor.LineNumbersOff\n\t}\n\tst.NoActiveLine, st.NoIndentGuides, st.NoScrollPastEnd = !s.HighlightLine, !s.DrawIndentGuides, !bool(s.ScrollPastEnd)\n\tst.CursorShape = s.cursorStyle().shape\n}\n\n// rulers is Sublime Text's rulers: columns, or lists of a column and the\n// ruler's style, which the editor leaves.\ntype rulers []int\n\nfunc (r *rulers) UnmarshalJSON(b []byte) error {\n\tvar items []any\n\tif err := json.Unmarshal(b, \u0026items); err != nil || items == nil {\n\t\treturn err\n\t}\n\t*r = rulers{}\n\tfor _, it := range items {\n\t\tif l, ok := it.([]any); ok \u0026\u0026 len(l) \u003e 0 {\n\t\t\tit = l[0]\n\t\t}\n\t\tif n, ok := it.(float64); ok {\n\t\t\t*r = append(*r, int(n))\n\t\t}\n\t}\n\treturn nil\n}\n\n// pastEnd is scroll_past_end: a bool, or how far past the end Sublime Text\n// scrolls, of which the editor tells none from some.\ntype pastEnd bool\n\nfunc (p *pastEnd) UnmarshalJSON(b []byte) error {\n\tvar v any\n\tif err := json.Unmarshal(b, \u0026v); err != nil {\n\t\treturn err\n\t}\n\tswitch v := v.(type) {\n\tcase bool:\n\t\t*p = pastEnd(v)\n\tcase float64:\n\t\t*p = v \u003e 0\n\t}\n\treturn nil\n}\n\nfunc (s *settings) font() ui.Font {\n\tif len(s.FontOptions) == 0 {\n\t\treturn ui.Font{Family: s.ContentFont, Size: s.FontSize}\n\t}\n\tvar off []string\n\tfor _, o := range s.FontOptions {\n\t\tswitch o {\n\t\tcase \"no_liga\", \"no_clig\", \"no_calt\":\n\t\t\toff = append(off, strings.TrimPrefix(o, \"no_\")+\"=0\")\n\t\t}\n\t}\n\treturn ui.Font{Family: s.ContentFont, Size: s.FontSize, Features: strings.Join(off, \",\")}\n}\n\nfunc (s *settings) lineHeight() float32 {\n\tif s.FontSize \u003c= 0 {\n\t\treturn 0\n\t}\n\t// 1.5 is the editor's own line height.\n\treturn 1.5 + (s.LinePaddingTop+s.LinePaddingBottom)/s.FontSize\n}\n\n// whiteSpace is draw_white_space: Sublime Text's options of where white\n// space is drawn, applied in order, or one of its older strings, \"none\",\n// \"selection\" or \"all\".\ntype whiteSpace []string\n\nfunc (w *whiteSpace) UnmarshalJSON(b []byte) error {\n\tvar s string\n\tif json.Unmarshal(b, \u0026s) == nil {\n\t\t*w = whiteSpace{s}\n\t\treturn nil\n\t}\n\treturn json.Unmarshal(b, (*[]string)(w))\n}\n\nconst (\n\twsSelection uint8 = 1 \u003c\u003c iota\n\twsLeading\n\twsEnclosed\n\twsTrailing\n\twsIsolated\n\twsAll = wsSelection | wsLeading | wsEnclosed | wsTrailing | wsIsolated\n)\n\nvar wsPlaces = map[string]uint8{\n\t\"selection\": wsSelection, \"leading\": wsLeading, \"enclosed\": wsEnclosed, \"trailing\": wsTrailing,\n\t\"isolated\": wsIsolated, \"all\": wsAll, \"none\": wsAll,\n}\n\n// mode is the editor's nearest to the options: white space at the ends\n// of lines alone is trailing, and anywhere else is all of it. Options of\n// tabs, spaces or mixed indentation alone draw both.\nfunc (w whiteSpace) mode() editor.Whitespace {\n\tvar on uint8\n\tfor _, o := range w {\n\t\tplace, kind, _ := strings.Cut(o, \"_\")\n\t\tif place == \"none\" || kind == \"none\" {\n\t\t\ton \u0026^= wsPlaces[place]\n\t\t} else {\n\t\t\ton |= wsPlaces[place]\n\t\t}\n\t}\n\tswitch {\n\tcase on\u0026(wsLeading|wsEnclosed) != 0:\n\t\treturn editor.WhitespaceAll\n\tcase on\u0026(wsTrailing|wsIsolated) != 0:\n\t\treturn editor.WhitespaceTrailing\n\tcase on\u0026wsSelection != 0:\n\t\treturn editor.WhitespaceSelection\n\t}\n\treturn editor.WhitespaceNone\n}\n\n// showScheme makes sc the theme of its appearance, and shows that\n// appearance where the windows showed the other.\nfunc (s *settings) showScheme(sc *scheme, shownDark bool) {\n\tif sc.dark {\n\t\ts.DarkTheme = sc.name\n\t} else {\n\t\ts.LightTheme = sc.name\n\t}\n\tif sc.dark != shownDark {\n\t\ts.Appearance = lightMode\n\t\tif sc.dark {\n\t\t\ts.Appearance = darkMode\n\t\t}\n\t}\n}\n\nfunc (s *settings) folderExcludes() []string {\n\tif s != nil \u0026\u0026 s.FolderExcludePatterns != nil {\n\t\treturn s.FolderExcludePatterns\n\t}\n\treturn folderExclude\n}\n\nfunc (s *settings) fileExcludes() []string {\n\tif s != nil \u0026\u0026 s.FileExcludePatterns != nil {\n\t\treturn s.FileExcludePatterns\n\t}\n\treturn fileExclude\n}\n\nfunc writeSettingsAtomic(dir string, data []byte) error {\n\tif err := os.MkdirAll(dir, 0o755); err != nil {\n\t\treturn err\n\t}\n\tpath := settingsPath(dir)\n\tfi, _ := os.Stat(path)\n\treturn writeFileAtomic(path, data, fi)\n}\n\n// saveSettings keeps the settings, and shows them in all windows. A\n// settings.json that does not parse is left for the user to fix.\nfunc (l *lime) saveSettings() {\n\tl.redraw()\n\tif l.dir == \"\" || l.setErr != nil {\n\t\treturn\n\t}\n\tb, err := json.MarshalIndent(l.set, \"\", \"\\t\")\n\tif err != nil {\n\t\treturn\n\t}\n\tif err := writeSettingsAtomic(l.dir, append(b, '\\n')); err != nil {\n\t\tgo mygo.Dialog.Error(locales.DialogUnableToSave(\"settings.json\"), err.Error())\n\t}\n}\n\nfunc (l *lime) setLanguage(tag string) {\n\tl.set.Language = tag\n\tl.saveSettings()\n\tmygo.App.SetLocale(l.set.locale())\n}\n\n// reloadSettings reads settings.json again once it is saved in a tab,\n// which the settings kept later would write over. A file that does not\n// parse leaves the settings as they are.\nfunc (l *lime) reloadSettings() {\n\ts, err := loadSettings(l.dir)\n\tif l.setErr = err; err != nil {\n\t\tgo mygo.Dialog.Error(locales.DialogUnableToReadSettings(), err.Error())\n\t\treturn\n\t}\n\trev := l.set.diffRev()\n\toldFolders, oldFiles := l.set.folderExcludes(), l.set.fileExcludes()\n\tl.set = s\n\tl.keys = newKeymap(l.set.Keys)\n\tmygo.App.SetLocale(l.set.locale())\n\tl.redraw()\n\tl.refreshMenu()\n\tif l.set.diffRev() != rev {\n\t\tfor _, a := range l.wins {\n\t\t\ta.reloadChanged()\n\t\t}\n\t}\n\tif !slices.Equal(oldFolders, l.set.folderExcludes()) || !slices.Equal(oldFiles, l.set.fileExcludes()) {\n\t\tfor _, a := range l.wins {\n\t\t\ta.proj.unwatch()\n\t\t\tclear(a.proj.watches)\n\t\t\ta.refreshFolders()\n\t\t}\n\t}\n}\n\nfunc (l *lime) redraw() {\n\tfor _, a := range l.wins {\n\t\tif a.win != nil {\n\t\t\ta.win.Update(func() {})\n\t\t}\n\t}\n}\n","package main\n\nimport (\n\t\"github.com/egoist/mygo/ui\"\n\t\"github.com/egoist/mygo/ui/editor\"\n)\n\n// scheme is a color scheme: GitHub's, Sublime Text's, Flexoki's or\n// Pierre's. The chrome around the editor derives from it, as Sublime's\n// Adaptive theme does.\ntype scheme struct {\n\tname        string\n\tdark        bool\n\tbg, fg      ui.Color\n\tcaret, sel  ui.Color\n\taccent      ui.Color\n\tactiveGuide ui.Color\n\tfind        ui.Color\n\tbracket     ui.Color\n\ttokens      map[editor.TokenKind]editor.TokenStyle\n\n\tcode *editor.Theme\n\t// caretless is code without carets, under carets drawn over the editor.\n\tcaretless *editor.Theme\n\tchSet     bool\n\tch        chrome\n}\n\nvar schemes = []*scheme{\n\t{\n\t\tname: \"GitHub Dark\", dark: true,\n\t\tbg: ui.Hex(\"#0d1117\"), fg: ui.Hex(\"#e6edf3\"), caret: ui.Hex(\"#2f81f7\"), sel: ui.Hex(\"#264f78\"),\n\t\taccent: ui.Hex(\"#2f81f7\"), activeGuide: ui.Hex(\"#6e7681\"), find: ui.Hex(\"#9e6a03\"), bracket: ui.Hex(\"#8b949e\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#ff7b72\", editor.TokenType: \"#ffa657\", editor.TokenFunction: \"#d2a8ff\",\n\t\t\teditor.TokenProperty: \"#79c0ff\", editor.TokenConstant: \"#79c0ff\", editor.TokenNumber: \"#79c0ff\",\n\t\t\teditor.TokenString: \"#a5d6ff\", editor.TokenEscape: \"#79c0ff\", editor.TokenRegexp: \"#7ee787\",\n\t\t\teditor.TokenComment: \"#8b949e\", editor.TokenOperator: \"#ff7b72\", editor.TokenTag: \"#7ee787\",\n\t\t\teditor.TokenAttribute: \"#79c0ff\", editor.TokenMeta: \"#d2a8ff\", editor.TokenHeading: \"#79c0ff/b\",\n\t\t\teditor.TokenLink: \"#a5d6ff\", editor.TokenCode: \"#a5d6ff\", editor.TokenInserted: \"#7ee787\",\n\t\t\teditor.TokenDeleted: \"#ffa198\", editor.TokenInvalid: \"#f85149\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"GitHub Light\",\n\t\tbg:   ui.Hex(\"#ffffff\"), fg: ui.Hex(\"#1f2328\"), caret: ui.Hex(\"#0969da\"), sel: ui.Hex(\"#0969da\").Alpha(0.2),\n\t\taccent: ui.Hex(\"#0969da\"), activeGuide: ui.Hex(\"#8c959f\"), find: ui.Hex(\"#d4a72c\"), bracket: ui.Hex(\"#6e7781\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#cf222e\", editor.TokenType: \"#953800\", editor.TokenFunction: \"#8250df\",\n\t\t\teditor.TokenProperty: \"#0550ae\", editor.TokenConstant: \"#0550ae\", editor.TokenNumber: \"#0550ae\",\n\t\t\teditor.TokenString: \"#0a3069\", editor.TokenEscape: \"#0550ae\", editor.TokenRegexp: \"#116329\",\n\t\t\teditor.TokenComment: \"#6e7781\", editor.TokenOperator: \"#cf222e\", editor.TokenTag: \"#116329\",\n\t\t\teditor.TokenAttribute: \"#0550ae\", editor.TokenMeta: \"#8250df\", editor.TokenHeading: \"#0550ae/b\",\n\t\t\teditor.TokenLink: \"#0a3069\", editor.TokenCode: \"#0a3069\", editor.TokenInserted: \"#1a7f37\",\n\t\t\teditor.TokenDeleted: \"#cf222e\", editor.TokenInvalid: \"#d1242f\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"GitHub Dark Dimmed\", dark: true,\n\t\tbg: ui.Hex(\"#22272e\"), fg: ui.Hex(\"#adbac7\"), caret: ui.Hex(\"#539bf5\"), sel: ui.Hex(\"#539bf5\").Alpha(0.2),\n\t\taccent: ui.Hex(\"#539bf5\"), activeGuide: ui.Hex(\"#636e7b\"), find: ui.Hex(\"#c69026\"), bracket: ui.Hex(\"#768390\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#f47067\", editor.TokenType: \"#f69d50\", editor.TokenFunction: \"#dcbdfb\",\n\t\t\teditor.TokenProperty: \"#6cb6ff\", editor.TokenConstant: \"#6cb6ff\", editor.TokenNumber: \"#6cb6ff\",\n\t\t\teditor.TokenString: \"#96d0ff\", editor.TokenEscape: \"#6cb6ff\", editor.TokenRegexp: \"#8ddb8c\",\n\t\t\teditor.TokenComment: \"#768390\", editor.TokenOperator: \"#f47067\", editor.TokenTag: \"#8ddb8c\",\n\t\t\teditor.TokenAttribute: \"#6cb6ff\", editor.TokenMeta: \"#dcbdfb\", editor.TokenHeading: \"#6cb6ff/b\",\n\t\t\teditor.TokenLink: \"#96d0ff\", editor.TokenCode: \"#96d0ff\", editor.TokenInserted: \"#8ddb8c\",\n\t\t\teditor.TokenDeleted: \"#ff938a\", editor.TokenInvalid: \"#f47067\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"GitHub Dark High Contrast\", dark: true,\n\t\tbg: ui.Hex(\"#0a0c10\"), fg: ui.Hex(\"#f0f3f6\"), caret: ui.Hex(\"#71b7ff\"), sel: ui.Hex(\"#ffffff\").Alpha(0.2),\n\t\taccent: ui.Hex(\"#71b7ff\"), activeGuide: ui.Hex(\"#9ea7b3\"), find: ui.Hex(\"#f0b72f\"), bracket: ui.Hex(\"#bdc4cc\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#ff9492\", editor.TokenType: \"#ffb757\", editor.TokenFunction: \"#dbb7ff\",\n\t\t\teditor.TokenProperty: \"#91cbff\", editor.TokenConstant: \"#91cbff\", editor.TokenNumber: \"#91cbff\",\n\t\t\teditor.TokenString: \"#addcff\", editor.TokenEscape: \"#91cbff\", editor.TokenRegexp: \"#72f088\",\n\t\t\teditor.TokenComment: \"#bdc4cc\", editor.TokenOperator: \"#ff9492\", editor.TokenTag: \"#72f088\",\n\t\t\teditor.TokenAttribute: \"#91cbff\", editor.TokenMeta: \"#dbb7ff\", editor.TokenHeading: \"#91cbff/b\",\n\t\t\teditor.TokenLink: \"#addcff\", editor.TokenCode: \"#addcff\", editor.TokenInserted: \"#72f088\",\n\t\t\teditor.TokenDeleted: \"#ffb1af\", editor.TokenInvalid: \"#ff9492\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"GitHub Light High Contrast\",\n\t\tbg:   ui.Hex(\"#ffffff\"), fg: ui.Hex(\"#0e1116\"), caret: ui.Hex(\"#0349b4\"), sel: ui.Hex(\"#0e1116\").Alpha(0.2),\n\t\taccent: ui.Hex(\"#0349b4\"), activeGuide: ui.Hex(\"#88929d\"), find: ui.Hex(\"#b58407\"), bracket: ui.Hex(\"#66707b\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#a0111f\", editor.TokenType: \"#702c00\", editor.TokenFunction: \"#622cbc\",\n\t\t\teditor.TokenProperty: \"#023b95\", editor.TokenConstant: \"#023b95\", editor.TokenNumber: \"#023b95\",\n\t\t\teditor.TokenString: \"#032563\", editor.TokenEscape: \"#023b95\", editor.TokenRegexp: \"#024c1a\",\n\t\t\teditor.TokenComment: \"#66707b\", editor.TokenOperator: \"#a0111f\", editor.TokenTag: \"#024c1a\",\n\t\t\teditor.TokenAttribute: \"#023b95\", editor.TokenMeta: \"#622cbc\", editor.TokenHeading: \"#023b95/b\",\n\t\t\teditor.TokenLink: \"#032563\", editor.TokenCode: \"#032563\", editor.TokenInserted: \"#024c1a\",\n\t\t\teditor.TokenDeleted: \"#a0111f\", editor.TokenInvalid: \"#a0111f\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"Mariana\", dark: true,\n\t\tbg: ui.Hex(\"#303841\"), fg: ui.Hex(\"#d8dee9\"), caret: ui.Hex(\"#f9ae58\"), sel: ui.Hex(\"#596673\").Alpha(0.7),\n\t\taccent: ui.Hex(\"#5c99d6\"), activeGuide: ui.Hex(\"#5fb4b4\"), find: ui.Hex(\"#fac761\"), bracket: ui.Hex(\"#f9ae58\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#c695c6\", editor.TokenType: \"#6699cc/i\", editor.TokenFunction: \"#5fb4b4\",\n\t\t\teditor.TokenConstant: \"#ec5f66/i\", editor.TokenNumber: \"#f9ae58\", editor.TokenString: \"#99c794\",\n\t\t\teditor.TokenEscape: \"#c695c6\", editor.TokenRegexp: \"#99c794\", editor.TokenComment: \"#a6acb9\",\n\t\t\teditor.TokenOperator: \"#f97b58\", editor.TokenTag: \"#ec5f66\", editor.TokenAttribute: \"#c695c6\",\n\t\t\teditor.TokenMeta: \"#6699cc\", editor.TokenHeading: \"#f97b58/b\", editor.TokenLink: \"#6699cc\",\n\t\t\teditor.TokenInserted: \"#99c794\", editor.TokenDeleted: \"#ec5f66\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"Monokai\", dark: true,\n\t\tbg: ui.Hex(\"#282923\"), fg: ui.Hex(\"#f8f8f2\"), caret: ui.Hex(\"#f8f8f0\"), sel: ui.Hex(\"#555449\").Alpha(0.7),\n\t\taccent: ui.Hex(\"#67d8ef\"), activeGuide: ui.Hex(\"#9f570f\"), find: ui.Hex(\"#ffe894\"), bracket: ui.Hex(\"#f8f8f2\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#f92472\", editor.TokenType: \"#67d8ef/i\", editor.TokenFunction: \"#a6e22c\",\n\t\t\teditor.TokenConstant: \"#ac80ff\", editor.TokenNumber: \"#ac80ff\", editor.TokenString: \"#e7db74\",\n\t\t\teditor.TokenEscape: \"#ac80ff\", editor.TokenRegexp: \"#e7db74\", editor.TokenComment: \"#74705d\",\n\t\t\teditor.TokenOperator: \"#f92472\", editor.TokenTag: \"#f92472\", editor.TokenAttribute: \"#a6e22c\",\n\t\t\teditor.TokenMeta: \"#67d8ef\", editor.TokenHeading: \"#a6e22c/b\", editor.TokenLink: \"#67d8ef\",\n\t\t\teditor.TokenInserted: \"#a6e22c\", editor.TokenDeleted: \"#f92472\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"Breakers\",\n\t\tbg:   ui.Hex(\"#fcfdfd\"), fg: ui.Hex(\"#333333\"), caret: ui.Hex(\"#5fb4b4\"), sel: ui.Hex(\"#d8dcdf\").Alpha(0.7),\n\t\taccent: ui.Hex(\"#5c99d6\"), activeGuide: ui.Hex(\"#5fb4b4\"), find: ui.Hex(\"#fac761\"), bracket: ui.Hex(\"#f9ae58\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#c695c6\", editor.TokenType: \"#6699cc/i\", editor.TokenFunction: \"#5fb4b4\",\n\t\t\teditor.TokenConstant: \"#ec5f66/i\", editor.TokenNumber: \"#f9ae58\", editor.TokenString: \"#80b979\",\n\t\t\teditor.TokenEscape: \"#c695c6\", editor.TokenRegexp: \"#80b979\", editor.TokenComment: \"#999999\",\n\t\t\teditor.TokenOperator: \"#f97b58\", editor.TokenTag: \"#ec5f66\", editor.TokenAttribute: \"#c695c6\",\n\t\t\teditor.TokenMeta: \"#6699cc\", editor.TokenHeading: \"#f97b58/b\", editor.TokenLink: \"#6699cc\",\n\t\t\teditor.TokenInserted: \"#80b979\", editor.TokenDeleted: \"#ec5f66\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"Celeste\",\n\t\tbg:   ui.Hex(\"#ffffff\"), fg: ui.Hex(\"#000000\"), caret: ui.Hex(\"#ff4d97\"), sel: ui.Hex(\"#333333\").Alpha(0.08),\n\t\taccent: ui.Hex(\"#f58a3d\"), activeGuide: ui.Hex(\"#e46767\"), find: ui.Hex(\"#ffdd33\"), bracket: ui.Hex(\"#f58a3d\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#000000/i\", editor.TokenType: \"#000000/i\", editor.TokenFunction: \"#f58a3d\",\n\t\t\teditor.TokenConstant: \"#000000/i\", editor.TokenNumber: \"#e46767\", editor.TokenString: \"#957350\",\n\t\t\teditor.TokenEscape: \"#f55c3d\", editor.TokenRegexp: \"#957350\", editor.TokenComment: \"#888888/i\",\n\t\t\teditor.TokenOperator: \"#666666\", editor.TokenPunctuation: \"#666666\", editor.TokenTag: \"#228ec3\",\n\t\t\teditor.TokenAttribute: \"#22c3a8\", editor.TokenHeading: \"#f58a3d/b\", editor.TokenLink: \"#228ec3\",\n\t\t\teditor.TokenInserted: \"#22c3a8\", editor.TokenDeleted: \"#e46767\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"Sixteen\",\n\t\tbg:   ui.Hex(\"#ffffff\"), fg: ui.Hex(\"#545454\"), caret: ui.Hex(\"#383838\"), sel: ui.Hex(\"#d6d6d6\").Alpha(0.7),\n\t\taccent: ui.Hex(\"#3c97dd\"), activeGuide: ui.Hex(\"#86c1b9\"), find: ui.Hex(\"#f4c725\"), bracket: ui.Hex(\"#f09642\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#ba8caf\", editor.TokenType: \"#545454/i\", editor.TokenFunction: \"#3c97dd\",\n\t\t\teditor.TokenConstant: \"#f09642\", editor.TokenNumber: \"#f09642\", editor.TokenString: \"#9dbf40\",\n\t\t\teditor.TokenEscape: \"#86c1b9\", editor.TokenRegexp: \"#86c1b9\", editor.TokenComment: \"#b8b8b8\",\n\t\t\teditor.TokenOperator: \"#86c1b9\", editor.TokenPunctuation: \"#999999\", editor.TokenTag: \"#d2322d\",\n\t\t\teditor.TokenAttribute: \"#f09642\", editor.TokenMeta: \"#d2322d\", editor.TokenHeading: \"#3c97dd/b\",\n\t\t\teditor.TokenLink: \"#3c97dd\", editor.TokenInserted: \"#9dbf40\", editor.TokenDeleted: \"#d2322d\",\n\t\t}),\n\t},\n\t// Flexoki marks selections and matches with borders, which the editor\n\t// does not draw: they take ui-2 and yellow, which show without one.\n\t{\n\t\tname: \"Flexoki Dark\", dark: true,\n\t\tbg: ui.Hex(\"#100f0f\"), fg: ui.Hex(\"#cecdc3\"), caret: ui.Hex(\"#fffcf0\"), sel: ui.Hex(\"#343331\"),\n\t\taccent: ui.Hex(\"#4385be\"), activeGuide: ui.Hex(\"#575653\"), find: ui.Hex(\"#d0a215\"), bracket: ui.Hex(\"#879a39\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#879a39\", editor.TokenType: \"#da702c\", editor.TokenFunction: \"#da702c\",\n\t\t\teditor.TokenConstant: \"#d0a215\", editor.TokenNumber: \"#8b7ec8\", editor.TokenString: \"#3aa99f\",\n\t\t\teditor.TokenEscape: \"#d14d41\", editor.TokenRegexp: \"#3aa99f\", editor.TokenComment: \"#575653\",\n\t\t\teditor.TokenOperator: \"#878580\", editor.TokenPunctuation: \"#878580\", editor.TokenTag: \"#4385be\",\n\t\t\teditor.TokenAttribute: \"#da702c\", editor.TokenMeta: \"#d0a215\", editor.TokenHeading: \"#575653/b\",\n\t\t\teditor.TokenLink: \"#3aa99f\", editor.TokenInserted: \"#879a39\", editor.TokenDeleted: \"#d14d41\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"Flexoki Light\",\n\t\tbg:   ui.Hex(\"#fffcf0\"), fg: ui.Hex(\"#100f0f\"), caret: ui.Hex(\"#100f0f\"), sel: ui.Hex(\"#dad8ce\"),\n\t\taccent: ui.Hex(\"#205ea6\"), activeGuide: ui.Hex(\"#b7b5ac\"), find: ui.Hex(\"#ad8301\"), bracket: ui.Hex(\"#66800b\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#66800b\", editor.TokenType: \"#bc5215\", editor.TokenFunction: \"#bc5215\",\n\t\t\teditor.TokenConstant: \"#ad8301\", editor.TokenNumber: \"#5e409d\", editor.TokenString: \"#24837b\",\n\t\t\teditor.TokenEscape: \"#af3029\", editor.TokenRegexp: \"#24837b\", editor.TokenComment: \"#b7b5ac\",\n\t\t\teditor.TokenOperator: \"#6f6e69\", editor.TokenPunctuation: \"#6f6e69\", editor.TokenTag: \"#205ea6\",\n\t\t\teditor.TokenAttribute: \"#bc5215\", editor.TokenMeta: \"#ad8301\", editor.TokenHeading: \"#b7b5ac/b\",\n\t\t\teditor.TokenLink: \"#24837b\", editor.TokenInserted: \"#66800b\", editor.TokenDeleted: \"#af3029\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"Pierre Dark\", dark: true,\n\t\tbg: ui.Hex(\"#0a0a0a\"), fg: ui.Hex(\"#fafafa\"), caret: ui.Hex(\"#009fff\"), sel: ui.Hex(\"#009fff\").Alpha(0.3),\n\t\taccent: ui.Hex(\"#009fff\"), activeGuide: ui.Hex(\"#636363\"), find: ui.Hex(\"#ffca00\"), bracket: ui.Hex(\"#009fff\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#ff678d\", editor.TokenType: \"#d568ea\", editor.TokenFunction: \"#9d6afb\",\n\t\t\teditor.TokenProperty: \"#ffa359\", editor.TokenConstant: \"#ffd452\", editor.TokenNumber: \"#68cdf2\",\n\t\t\teditor.TokenString: \"#5ecc71\", editor.TokenEscape: \"#61d5c0\", editor.TokenRegexp: \"#64d1db\",\n\t\t\teditor.TokenComment: \"#737373\", editor.TokenOperator: \"#08c0ef\", editor.TokenPunctuation: \"#636363\",\n\t\t\teditor.TokenTag: \"#ff855e\", editor.TokenAttribute: \"#60d199\", editor.TokenMeta: \"#69b1ff\",\n\t\t\teditor.TokenHeading: \"#ff855e/b\", editor.TokenLink: \"#009fff\", editor.TokenCode: \"#5ecc71\",\n\t\t\teditor.TokenInserted: \"#07c480\", editor.TokenDeleted: \"#ff2e3f\", editor.TokenInvalid: \"#ff2e3f\",\n\t\t}),\n\t},\n\t{\n\t\tname: \"Pierre Light\",\n\t\tbg:   ui.Hex(\"#ffffff\"), fg: ui.Hex(\"#0a0a0a\"), caret: ui.Hex(\"#009fff\"), sel: ui.Hex(\"#009fff\").Alpha(0.18),\n\t\taccent: ui.Hex(\"#009fff\"), activeGuide: ui.Hex(\"#8a8a8a\"), find: ui.Hex(\"#d5a910\"), bracket: ui.Hex(\"#009fff\"),\n\t\ttokens: tokens(map[editor.TokenKind]string{\n\t\t\teditor.TokenKeyword: \"#d32a61\", editor.TokenType: \"#a631be\", editor.TokenFunction: \"#693acf\",\n\t\t\teditor.TokenProperty: \"#d47628\", editor.TokenConstant: \"#d5a910\", editor.TokenNumber: \"#1ca1c7\",\n\t\t\teditor.TokenString: \"#199f43\", editor.TokenEscape: \"#16a994\", editor.TokenRegexp: \"#17a5af\",\n\t\t\teditor.TokenComment: \"#737373\", editor.TokenOperator: \"#08c0ef\", editor.TokenPunctuation: \"#636363\",\n\t\t\teditor.TokenTag: \"#d5512f\", editor.TokenAttribute: \"#18a46c\", editor.TokenMeta: \"#1a85d4\",\n\t\t\teditor.TokenHeading: \"#d5512f/b\", editor.TokenLink: \"#009fff\", editor.TokenCode: \"#199f43\",\n\t\t\teditor.TokenInserted: \"#18a46c\", editor.TokenDeleted: \"#d52c36\", editor.TokenInvalid: \"#d52c36\",\n\t\t}),\n\t},\n}\n\nfunc tokens(m map[editor.TokenKind]string) map[editor.TokenKind]editor.TokenStyle {\n\tout := make(map[editor.TokenKind]editor.TokenStyle, len(m))\n\tfor k, s := range m {\n\t\tout[k] = editor.TokenStyle{Color: ui.Hex(s[:7]), Italic: len(s) \u003e 7 \u0026\u0026 s[8] == 'i', Bold: len(s) \u003e 7 \u0026\u0026 s[8] == 'b'}\n\t}\n\treturn out\n}\n\nfunc schemeNamed(name string) *scheme {\n\tfor _, s := range schemes {\n\t\tif s.name == name {\n\t\t\treturn s\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (s *settings) scheme(systemDark bool) *scheme {\n\treturn s.theme(s.Appearance == darkMode || s.Appearance != lightMode \u0026\u0026 systemDark)\n}\n\nfunc (s *settings) theme(dark bool) *scheme {\n\tname, fallback := s.LightTheme, \"GitHub Light\"\n\tif dark {\n\t\tname, fallback = s.DarkTheme, \"GitHub Dark\"\n\t}\n\tif sc := schemeNamed(name); sc != nil \u0026\u0026 sc.dark == dark {\n\t\treturn sc\n\t}\n\treturn schemeNamed(fallback)\n}\n\nvar black = ui.RGB(0, 0, 0)\n\nfunc (s *scheme) danger() ui.Color { return s.tokens[editor.TokenDeleted].Color }\n\ntype chrome struct {\n\tbg, hover, line, panel, tab ui.Color\n\ttext, muted                 ui.Color\n}\n\nfunc (s *scheme) chrome() chrome {\n\tif s.chSet {\n\t\treturn s.ch\n\t}\n\tshade := func(dark, light float32) ui.Color {\n\t\tif s.dark {\n\t\t\treturn s.bg.Mix(black, dark)\n\t\t}\n\t\treturn s.bg.Mix(black, light)\n\t}\n\tpanel := s.bg.Mix(ui.RGB(255, 255, 255), 0.06)\n\tif !s.dark {\n\t\tpanel = s.bg\n\t}\n\ts.ch = chrome{\n\t\tbg: shade(0.2, 0.05), hover: shade(0.1, 0.025), line: shade(0.38, 0.13), panel: panel, tab: s.bg,\n\t\ttext: s.fg, muted: s.fg.Mix(s.bg, 0.4),\n\t}\n\ts.chSet = true\n\treturn s.ch\n}\n\n// shell is the chrome of the side bar, the tab bars and the status bar,\n// which leave the window's material showing where it shows.\nfunc (a *app) shell(c *ui.Context) chrome {\n\tch := a.scheme.chrome()\n\tif c.Vibrancy() {\n\t\tch.bg, ch.hover, ch.tab = ui.Transparent, ch.text.Alpha(0.08), ch.tab.Alpha(0.5)\n\t}\n\treturn ch\n}\n\nfunc (s *scheme) uiTheme(base *ui.Theme) *ui.Theme {\n\tt := *base\n\tch := s.chrome()\n\tt.Dark = s.dark\n\tt.Background, t.Text, t.TextMuted, t.Border = ch.bg, ch.text, ch.muted, ch.line\n\tt.Surface, t.SurfaceHover, t.SurfacePressed = ch.panel, ch.panel.Mix(s.fg, 0.08), ch.panel.Mix(s.fg, 0.14)\n\tt.Accent, t.AccentHover, t.AccentPressed = s.accent, s.accent.Mix(s.fg, 0.15), s.accent.Mix(black, 0.15)\n\tt.Selection, t.Focus = s.sel, s.accent.Alpha(0.6)\n\treturn \u0026t\n}\n\nfunc (s *scheme) editorTheme() *editor.Theme {\n\tif s.code != nil {\n\t\treturn s.code\n\t}\n\tbase := ui.LightTheme()\n\tif s.dark {\n\t\tbase = ui.DarkTheme()\n\t}\n\tth := editor.DefaultTheme(base)\n\tclear(th.Tokens[:])\n\tfor k, st := range s.tokens {\n\t\tth.Tokens[k] = st\n\t}\n\tth.Tokens[editor.TokenEmphasis] = editor.TokenStyle{Italic: true}\n\tth.Tokens[editor.TokenStrong] = editor.TokenStyle{Bold: true}\n\tth.Background, th.Text = s.bg, s.fg\n\tth.LineNumber, th.ActiveLineNumber = s.fg.Mix(s.bg, 0.55), s.fg\n\tth.Selection, th.InactiveSelection = s.sel, s.sel\n\tth.Cursor, th.MatchingBracket = s.caret, s.bracket\n\tth.Match, th.CurrentMatch = s.find.Alpha(0.3), s.find.Alpha(0.55)\n\tth.IndentGuide, th.ActiveIndentGuide = s.fg.Alpha(0.12), s.activeGuide.Alpha(0.7)\n\tth.Whitespace = s.fg.Alpha(0.3)\n\tred, orange, green := s.tokens[editor.TokenDeleted].Color, s.tokens[editor.TokenNumber].Color, s.tokens[editor.TokenInserted].Color\n\tth.Error, th.Warning, th.Info = red, orange, s.accent\n\tth.Added, th.Deleted, th.Modified = green, red, orange\n\ts.code = th\n\treturn th\n}\n\nfunc (s *scheme) caretlessTheme() *editor.Theme {\n\tif s.caretless == nil {\n\t\tth := *s.editorTheme()\n\t\tth.Cursor = s.caret.Alpha(0)\n\t\ts.caretless = \u0026th\n\t}\n\treturn s.caretless\n}\n"],"deltas":[[8,127,-2,"\t\tbind(ctrl, ui.KeyPeriod, editor.NextHunk), bind(ctrl, ui.KeyComma, editor.PreviousHunk),",183],[0,1,-1,6],[3,36,-4],[4,8,-4,14],[6,51,-1,166],[5,459,-4,329],[16,103,-1,"\t\t\t\tmygo.RunOnMain(l.autosave)",113],[18,37,-1,"\t\ta.l.last, a.l.menuState = a, \"\"",5,-1,"\t\t\ta.proj.dirs = nil",8,-1,164],[10,225,-3,169],[11,24,-2,238,-3,10,-1,"\treturn chrome{",3,-2,61],[14,3,"# A development build with live reload: rebuilds and relaunches as the","# code changes.",26,"# The website, with Lime running in it as WebAssembly, into build/site.",7],[7,33,"// withDoc runs fn on the current doc, when it shows text.",8,"// withSource runs fn on the doc whose text the current tab edits, a diff","// tab's new one.",8,"// edit runs cmd in the current editor, or the side of a diff that has","// the keyboard.",12,"// currentTracked reports whether git has the current tab's file.",86,"// revertDoc reloads d's file from disk, discarding any unsaved changes.",458,"// jsonError puts the caret where src, at offset at, fails to parse as","// JSON, and tells why in the status bar.",43],[12,56,"\t\t// Sublime Text's own.",114,"// appKeys are the window's keys as Sublime Text has them.",78,"// keyNames names keys for menus' accelerators and, on macOS, for showing.",26,"// accelerator writes a key as a menu item's Accelerator.",13,"// shortcutText shows a key as the platform does: ⌃⌥⇧⌘K on macOS,","// Ctrl+Shift+K elsewhere.",24],[9,21,-3,"\tpending                    bool      // the current editor's panel takes them as it next shows","\tseen                       string    // the query of the current editor's panel, as last read","\trowsAt                     time.Time // when the current editor's panel last showed or hid the replace row",114,"// findBar builds the find panel of d's editor as Sublime Text's, along","// the bottom of the editor: the options, the query and the buttons, and","// the replacement below them while replacing.",99],[20,17,"// settings are what the app keeps between runs, in settings.json.",1,-24,"\t// Language is the tag of a language of the app's catalogs, as","\t// \"zh-Hans\", or followSystem.","\tLanguage string `json:\"language\"`","\t// Appearance is followSystem, lightMode or darkMode: whether the","\t// windows show LightTheme or DarkTheme.","\tAppearance   string  `json:\"appearance\"`","\tLightTheme   string  `json:\"light_theme\"`","\tDarkTheme    string  `json:\"dark_theme\"`","\tUIFont       string  `json:\"ui_font\"`      // \"\" is the system's","\tContentFont  string  `json:\"content_font\"` // \"\" is the system's monospaced font","\tFontSize     float32 `json:\"font_size\"`","\tWordWrap     bool    `json:\"word_wrap\"`","\tSideBar      bool    `json:\"side_bar\"`","\tSideBarWidth float32 `json:\"side_bar_width\"`","\tTabSize      int     `json:\"tab_size\"`","\t// Rulers are the columns guides are drawn at.","\tRulers           rulers     `json:\"rulers\"`","\tDrawWhiteSpace   whiteSpace `json:\"draw_white_space\"`","\tLineNumbers      bool       `json:\"line_numbers\"`","\tHighlightLine    bool       `json:\"highlight_line\"`","\tDrawIndentGuides bool       `json:\"draw_indent_guides\"`","\tScrollPastEnd    pastEnd    `json:\"scroll_past_end\"`","\t// LayoutStyle is the name of a layoutStyle: how the groups sit in the","\t// window.","\tLayoutStyle string `json:\"layout_style\"`","\t// FileIcons is the name of a fileIconSet: which icons files and folders show.","\tFileIcons string `json:\"file_icons\"`","\t// ShowScrollBars draws the text's scroll bars.","\tShowScrollBars bool `json:\"show_scroll_bars\"`","\t// CursorStyle is the name of a cursorStyle: how the carets look.","\tCursorStyle string `json:\"cursor_style\"`","\t// TypingMode is \"normal\", or \"rampage\" for bursts and trails at the","\t// carets as they type, delete and jump.","\tTypingMode string `json:\"typing_mode\"`","\t// LinePaddingTop and LinePaddingBottom add DIPs above and below each","\t// line.","\tLinePaddingTop    float32 `json:\"line_padding_top\"`","\tLinePaddingBottom float32 `json:\"line_padding_bottom\"`",8,-2,"\t// AutoComplete shows completions as words are typed.","\tAutoComplete bool `json:\"auto_complete\"`","\t// DetectIndentation has a file indent as its lines do as it opens,","\t// in place of TabSize and TranslateTabsToSpaces.","\tDetectIndentation bool `json:\"detect_indentation\"`",3,-4,"\t// DiffUnified lays commits' diffs out one over the other rather than","\t// side by side.","\tDiffUnified bool `json:\"diff_unified\"`","\t// GitTreeView shows the git panel's changes in the tree of their","\t// folders rather than as a list.","\tGitTreeView bool `json:\"git_tree_view\"`","\t// GitDiffTarget is the text in git that the gutter marks a file's","\t// changes against: \"index\", or \"head\" for the last commit's.","\tGitDiffTarget string `json:\"git_diff_target\"`","\t// InlineBlame shows who last changed the caret's line at its end, as","\t// Zed's inline blame does.","\tInlineBlame bool `json:\"inline_blame\"`",21,"// dataDir is where the app keeps its settings and session.",10,"// loadSettings reads settings.json over the defaults, and returns the","// error of a file that does not parse.",38,"// locale is the language App.SetLocale shows for Language: \"\" follows","// the system.",7,"// layoutStyle is the style LayoutStyle names, compact for a name it","// doesn't know.",9,"// fileIcons is the icon set FileIcons names, file-icons for a name it","// doesn't know.",9,"// cursorStyle is the style CursorStyle names, bars for a name it doesn't","// know.",16,"// indent is what TranslateTabsToSpaces has indenting insert.",6,"// display shows the text of st as the settings say.",49,"// font is the content font, as editors take it.",11,"// lineHeight is the height of lines as a multiple of the font's size.",90,"// writeSettingsAtomic writes settings.json via a temp file and rename in dir","// so an interrupted write leaves the previous file intact.",25,"// setLanguage shows the language of tag, or the system's for","// followSystem, and keeps it.",36,"// redraw builds the windows anew, for a change they share.",8],[21,220,"// tokens reads styles written as \"#rrggbb\", with \"/i\" for italic and","// \"/b\" for bold.",17,"// scheme returns the scheme the windows show: the theme of the","// appearance, systemDark choosing while it follows the system.",4,"// theme returns the theme of the dark or the light appearance. A theme","// that is not one of the schemes of its appearance gives way to GitHub's.",13,"// danger is the color of what went wrong, as a key two commands have.",2,"// chrome holds the colors around the editor: tab bars, the side bar, the","// status bar, the quick panel. tab is the active tab's background.",32,"// uiTheme is the window's theme for the scheme: the widgets of the side","// bar, the find bar and the quick panel.",11,"// editorTheme is the editor's theme for the scheme.",32,"\t\t// The editor takes a zero color for its default: this one is clear,","\t\t// but not zero.",6],[17,14,-1,13,-1,71,-1,9,-1,35,-1,1,-4,177,-4,163,-11,281],[23,6,-1,5,-1,59,-115,46,-1,1,-20,102,-2,"\t\t{id: \"open_markdown_preview\", caption: locales.Messages.CmdOpenPreview, run: withDoc(func(a *app, d *doc) { a.openPreview(d, false) })},","\t\t{id: \"open_markdown_preview_to_the_side\", caption: locales.Messages.CmdOpenPreviewToTheSide, run: withDoc(func(a *app, d *doc) { a.openPreview(d, true) })},",33,-2,"\t\tedit(\"find_next\", nil, editor.FindNext),","\t\tedit(\"find_prev\", nil, editor.FindPrevious),",192,-3,"\t\tlead := len(src) - len(strings.TrimLeft(src, \" \\t\\r\\n\"))","\t\tsrc = strings.TrimSpace(src)",68],[24,75,"\t\tbind(cmd, ui.KeyG, editor.FindNext), bind(cmd|sh, ui.KeyG, editor.FindPrevious),",53,"\t\tbind(0, ui.KeyF3, editor.FindNext), bind(sh, ui.KeyF3, editor.FindPrevious),",109,-2,"\t\tkeys = append(keys, k(cmd|alt, ui.KeyF, \"show_panel replace\"), k(ctrl|cmd, ui.KeyG, \"find_all_under\"), k(cmd, ui.KeyT, \"show_goto\"), k(cmd|alt, ui.KeyS, \"save_all\"),",4,-2,"\t\tkeys = append(keys, k(ctrl, ui.KeyH, \"show_panel replace\"), k(alt, ui.KeyF3, \"find_all_under\"), k(ctrl, ui.KeyF4, \"close\"),",72],[25,6,-1,30,-9,"\t\td.cmp.diff.Find(s.query)",10,-24,64,-1,"\tcase d != a.current():",55,-8,16,-1,9,-1,5],[2,9,-1,13,"\tgolang.org/x/sys v0.50.0 // indirect",2],[28,591,-2,2,-1,1,-5,162],[26,6,-1,78,-4,263,-25,11,-3,"\tos.MkdirAll(l.dir, 0o755)","\tos.WriteFile(settingsPath(l.dir), b, 0o644)",20,-1,8,-7,13],[32,7,-1,7,"\tgithub.com/ebitengine/purego v0.11.3 // indirect",10],[33,15,-2,307,-5,427],[19,7,-1,2,-2,5,-1,41,-1,"\tvar paths []string","\tfor _, arg := range os.Args[1:] {","\t\tif !strings.HasPrefix(arg, \"-\") {","\t\t\tpaths = append(paths, arg)","\t\t}","\t}","\tl.last.open(paths)",49,-105,2],[15,6,-1,15],[36,130,-2,76,-5,402,-1,133],[29,294,-7,217],[34,43,-2,72,-1,"\t\tFontSize: defaultFontSize, WordWrap: true, SideBar: true, SideBarWidth: 220, LayoutStyle: compactLayout, TabSize: 4, AutoComplete: true,",52,-11,220],[27,7,-2,"// scheme is a color scheme: GitHub's, as its Primer colors have it, or","// one of Sublime Text's or Flexoki's, its colors taken from their","// .sublime-color-scheme files. The chrome around the editor derives from it, as Sublime's",179,-28,135]],"commits":[{"hash":"dbc9acd7d87ed83bbaa19a5f77dbd22d3343bb9c","body":"fix(keys): resolve non-macOS Ctrl+, conflict and enable cross-platform CI tests (#130)\n\n* fix(keys): move non-macOS hunk navigation to Alt\n\n* test: fix non-macOS git identity and tab shortcut\n\n* ci: run full test suite on Linux and Windows\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795494850,"tree":{".gitignore":0,"AGENTS.md":1,"cmd/lime/commands.go":7,"cmd/lime/find.go":9,"cmd/lime/keys.go":8,"cmd/lime/main.go":6,"cmd/lime/settings.go":10,"cmd/lime/theme.go":11,"go.mod":2,"locales/en.json":5,"mise.toml":3,"mygo.json":4}},{"hash":"2117c67995ac318e8f4cc9c1212b020ed891c759","body":"feat(website): spark/rampage demo defaults, AVIF/WebP assets, OG card, and Cloudflare config (#129)\n\n* feat(website): enable spark and rampage in demo\n\n* feat(website): compress images and update copy\n\nDrop Linux from download copy and grid, add Open Graph and Twitter Card\nmeta tags for lime.xingkaixin.me, and encode site icons as AVIF, WebP,\nand optimized PNG with optional OG image optimization.\n\n* chore(website): add Cloudflare deploy config\n\n* assets(website): add landing page Open Graph image\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795494303,"tree":{".gitignore":0,"AGENTS.md":1,"cmd/lime/commands.go":7,"cmd/lime/find.go":9,"cmd/lime/keys.go":12,"cmd/lime/main.go":6,"cmd/lime/settings.go":10,"cmd/lime/theme.go":11,"go.mod":2,"locales/en.json":5,"mise.toml":3,"mygo.json":4}},{"hash":"71dede9d677237c24672b10364fc78c9062e0a20","body":"ci: add baseline CI, native auto-updater, and macOS/Windows release workflow (#128)\n\n* feat(updater): integrate native auto-updater\n\n* ci: add baseline CI workflow\n\n* build(dmg): add headless custom DMG repack tool\n\n* ci: add macOS and Windows release workflow\n\n* assets(dmg): add custom macOS DMG background\n\n* ci: split Linux lint/cross-build from macOS test job\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795494054,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":7,"cmd/lime/find.go":9,"cmd/lime/keys.go":12,"cmd/lime/main.go":6,"cmd/lime/settings.go":10,"cmd/lime/theme.go":11,"go.mod":2,"locales/en.json":5,"mise.toml":14,"mygo.json":4}},{"hash":"138af97854d78c87d7400951ebdaafa1be0235ad","body":"feat(tabs): add overflow navigation controls and Ctrl+Tab switcher (#127)\n\n* feat(tabs): add overflow scroll controls and open tabs menu\n\n* feat(tabs): add Ctrl+Tab visual tab switcher overlay\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795450844,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":7,"cmd/lime/find.go":9,"cmd/lime/keys.go":12,"cmd/lime/main.go":16,"cmd/lime/settings.go":10,"cmd/lime/theme.go":11,"go.mod":2,"locales/en.json":5,"mise.toml":14,"mygo.json":15}},{"hash":"452255435fdea6f20d73824adae83f213456e0fc","body":"fix: reduce large-document memory spikes and retention (#126)\n\n* fix(session): coalesce autosave and cap unsaved snapshots\n\nSkip embedding unsaved buffers larger than largeFile during periodic\nautosave, coalesce concurrent autosave jobs into a single worker so\nstale snapshots do not pile up, and stream session JSON to disk.\n\n* fix(memory): clear oversized clip cache and reclaim idle heap\n\nDrop oversized entries (\u003e largeFile) from editor.lastClip and skip\nsplitting oversized clipboard text in multi-cursor paste. Track each\ndocument's peak size so closing or shrinking a previously large buffer\nstill schedules debug.FreeOSMemory, and reclaim large unreturned idle\nheaps on idle ticks.\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795449283,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":7,"cmd/lime/find.go":9,"cmd/lime/keys.go":12,"cmd/lime/main.go":16,"cmd/lime/settings.go":10,"cmd/lime/theme.go":11,"go.mod":2,"locales/en.json":17,"mise.toml":14,"mygo.json":15}},{"hash":"74d73c9bea150c55a5abe276181a92ae217fe8bd","body":"perf: reduce runtime/UI latency, WASM bytes, and web startup waterfall (#125)\n\n* perf(icons): index icon lookup and lazy-load fonts\n\n* perf(git): cache git marks and use JS NFC in WASM\n\n* perf(wasm): offload legacy codecs to TextDecoder\n\n* perf(ui): virtualize sidebar and cache hot paths\n\n* perf(website): shrink assets and remove waterfall\n\n* test(perf): add latency benchmarks and regressions\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795445131,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":7,"cmd/lime/find.go":9,"cmd/lime/keys.go":12,"cmd/lime/main.go":18,"cmd/lime/settings.go":10,"cmd/lime/theme.go":11,"go.mod":2,"locales/en.json":17,"mise.toml":14,"mygo.json":15}},{"hash":"785425cfc8809cda4564aaadb9b0e54bf797db21","body":"chore: audit codebase comments and document design decisions (#117)\n\n* chore: remove redundant, outdated, and excuse comments\n\n* docs: record codebase design and architecture decisions\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795234764,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":7,"cmd/lime/find.go":9,"cmd/lime/keys.go":12,"cmd/lime/main.go":19,"cmd/lime/settings.go":20,"cmd/lime/theme.go":21,"go.mod":2,"locales/en.json":17,"mise.toml":14,"mygo.json":15}},{"hash":"e5a22666a3622c0cd662d88870f2f470117b00b3","body":"feat(ux): guard Cmd+K chords, share Find Next across tabs, and add tab/status actions (#103)\n\n* fix(find): share query across tabs and harden input\n\n* feat(ux): guard Cmd+K chords and add tab/status actions\n\n* test(ux): add tests for chords, find, and tab actions\n\n* fix(editor): Keep shortcuts and tab actions scoped\n\n* fix(keys): Suppress chord replay across focus changes\n\n* fix: restore native menu shortcuts after chords\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795089620,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":23,"cmd/lime/find.go":25,"cmd/lime/keys.go":24,"cmd/lime/main.go":19,"cmd/lime/settings.go":26,"cmd/lime/theme.go":27,"go.mod":2,"locales/en.json":17,"mise.toml":22,"mygo.json":15}},{"hash":"9aaff770d846486f8636988ad6681dc3921eb185","body":"feat: project exclude patterns, gitignore indexing, watch debounce, and settings UX (#101)\n\n* feat(settings): add atomic saves and missing settings controls\n\nAdd configurable folder_exclude_patterns and file_exclude_patterns with\nbackward-compatible defaults, write settings.json atomically with error\nreporting, expose missing editor/git/encoding toggles in Settings, and\nskip redundant saves when Rulers or control values are unchanged.\n\n* feat(project): add gitignore indexing, watch debounce, and JSONC\n\n- Apply .gitignore rules during folder indexing while keeping ignored\n  entries visible in the side bar\n- Debounce watchDir bursts to coalesce git marks, re-indexing, and\n  external reload of open tabs\n- Parse JSONC .sublime-project files and preserve unknown fields\n- Sync rename/delete across windows, close orphaned diff/preview views,\n  harden confirmation dialogs, and support safe nested path creation\n\n* test(project): add tests for excludes, JSONC, sidebar, and settings\n\n* fix(project): Keep metadata and honor Git index rules\n\n* fix(project): Index nested repositories and retain ACLs\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795089581,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":29,"cmd/lime/find.go":31,"cmd/lime/keys.go":30,"cmd/lime/main.go":19,"cmd/lime/settings.go":26,"cmd/lime/theme.go":27,"go.mod":2,"locales/en.json":28,"mise.toml":22,"mygo.json":15}},{"hash":"6bd6436b6acc860e62f8a1583d6a36683db47b3b","body":"fix: harden file safety, save/close lifecycle, and CLI opening (#100)\n\n* fix(app): harden file saving, open dedup, and dialogs\n\nUse atomic temp-file writes preserving symlinks, prompt before overwriting\nexternally modified files, guard stacked or failed save/close dialogs,\nchain Save All and multi-window close across all untitled tabs, preserve\nencoding when Save with Encoding is canceled, deduplicate symlinked paths,\nand read opened files in a single pass.\n\n* fix(session): track sidebar state and retry autosaves\n\n* feat(cli): support --, file:line:col, and new files\n\n* fix(keymap): deduplicate repeated keys per command\n\n* test(lime): add file safety and lifecycle tests\n\n* fix(save): Honor conflicts and file permissions\n\n* fix(save): Preserve ACLs and follow moved tabs\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795089500,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":29,"cmd/lime/find.go":31,"cmd/lime/keys.go":30,"cmd/lime/main.go":19,"cmd/lime/settings.go":34,"cmd/lime/theme.go":27,"go.mod":32,"locales/en.json":33,"mise.toml":22,"mygo.json":15}},{"hash":"c1bd48ac44912ffdbcceee47f3ba918751db3404","body":"feat: add Pierre file icon theme (#97)\n\n* feat(icons): add Pierre SVG assets and generator\n\n* feat: add file_icons setting with Pierre icon theme\n\nAdd a file_icons setting (default \"file-icons\", or \"pierre\") to switch\nfile and folder icons between Atom file-icons and Pierre Icons.\n\nSingle-color Pierre SVGs draw through ui.Icon for atlas caching, while\ndual-color icons (Python, Astro, Webpack) draw through ui.Image and fall\nback to monochrome ui.Icon when overridden by a row selection tint.\nExpose the switch in Settings \u003e Appearance, the command palette, and the\nShortcuts list.\n\n* fix: Ship the Pierre icon license\n\n* build: Pin the Pierre icon source revision\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795060301,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":29,"cmd/lime/find.go":31,"cmd/lime/keys.go":30,"cmd/lime/main.go":37,"cmd/lime/settings.go":34,"cmd/lime/theme.go":27,"go.mod":35,"locales/en.json":36,"mise.toml":22,"mygo.json":15}},{"hash":"f8ae923ed6aa15e09ac0925e774463eb876ba246","body":"feat(theme): Add Pierre Dark and Light schemes (#96)\n\n* feat(theme): Add Pierre Dark and Light schemes\n\nColors come from pierrecomputer/theme's pierre-dark and pierre-light\npalettes, mapped to Lime's token kinds. Active indent guides use the\npalette's fg4 neutral stop so they stay visible above the 12% inactive\nguide, and TokenInvalid uses states.danger because the editor draws\nforeground colors without a token background.\n\n* docs: Credit Pierre for its color palettes\n","name":"Kevin","email":"xingkaixin@gmail.com","time":1795060288,"tree":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":40,"cmd/lime/find.go":31,"cmd/lime/keys.go":30,"cmd/lime/main.go":37,"cmd/lime/settings.go":41,"cmd/lime/theme.go":27,"go.mod":35,"locales/en.json":39,"mise.toml":22,"mygo.json":38}}],"parent":{".gitignore":13,"AGENTS.md":1,"cmd/lime/commands.go":40,"cmd/lime/find.go":31,"cmd/lime/keys.go":30,"cmd/lime/main.go":37,"cmd/lime/settings.go":41,"cmd/lime/theme.go":42,"go.mod":35,"locales/en.json":39,"mise.toml":22,"mygo.json":38}}