diff --git a/README.md b/README.md index be5a51b..eefd3fc 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,24 @@ Available for Mac, Windows, and Linux. - Syntax highlighting - C++ - C# + - Clojure - CSS + - Erlang + - Go - HTML - Java - JavaScript - JSON + - Lezer - Markdown - PHP - Python + - Ruby - Rust + - Shell - SQL - XML + - YAML - Language auto-detection - Auto-formatting - Math/Calculator mode diff --git a/package-lock.json b/package-lock.json index 8500eb5..b30b3c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@codemirror/lang-sql": "^6.5.4", "@codemirror/lang-xml": "^6.0.2", "@codemirror/language": "^6.9.3", + "@codemirror/legacy-modes": "^6.3.3", "@codemirror/lint": "^6.4.2", "@codemirror/search": "^6.5.5", "@codemirror/state": "^6.3.3", @@ -453,6 +454,15 @@ "style-mod": "^4.0.0" } }, + "node_modules/@codemirror/legacy-modes": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.3.3.tgz", + "integrity": "sha512-X0Z48odJ0KIoh/HY8Ltz75/4tDYc9msQf1E/2trlxFaFFhgjpVHjZ/BCXe1Lk7s4Gd67LL/CeEEHNI+xHOiESg==", + "dev": true, + "dependencies": { + "@codemirror/language": "^6.0.0" + } + }, "node_modules/@codemirror/lint": { "version": "6.4.2", "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz", diff --git a/package.json b/package.json index 51867ff..65fce09 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@codemirror/lang-sql": "^6.5.4", "@codemirror/lang-xml": "^6.0.2", "@codemirror/language": "^6.9.3", + "@codemirror/legacy-modes": "^6.3.3", "@codemirror/lint": "^6.4.2", "@codemirror/search": "^6.5.5", "@codemirror/state": "^6.3.3", diff --git a/playwright.config.ts b/playwright.config.ts index 22c3505..d167fb1 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -41,7 +41,7 @@ export default defineConfig({ name: 'firefox', use: { ...devices['Desktop Firefox'] }, }, - + { name: 'webkit', use: { ...devices['Desktop Safari'] }, diff --git a/public/langdetect-worker.js b/public/langdetect-worker.js index b1c5b9b..3f93c6d 100644 --- a/public/langdetect-worker.js +++ b/public/langdetect-worker.js @@ -14,6 +14,12 @@ GUESSLANG_LANGUAGES = [ "rs", "md", "cs", + "rb", + "sh", + "yaml", + "go", + "clj", + "erl", ] const guessLang = new self.GuessLang() diff --git a/src/components/LanguageSelector.vue b/src/components/LanguageSelector.vue index de4a848..b43373f 100644 --- a/src/components/LanguageSelector.vue +++ b/src/components/LanguageSelector.vue @@ -37,9 +37,20 @@ if (event.key === "ArrowDown") { this.selected = Math.min(this.selected + 1, this.filteredItems.length - 1) event.preventDefault() + if (this.selected === this.filteredItems.length - 1) { + this.$refs.container.scrollIntoView({block: "end"}) + } else { + this.$refs.item[this.selected].scrollIntoView({block: "nearest"}) + } + } else if (event.key === "ArrowUp") { this.selected = Math.max(this.selected - 1, 0) event.preventDefault() + if (this.selected === 0) { + this.$refs.container.scrollIntoView({block: "start"}) + } else { + this.$refs.item[this.selected].scrollIntoView({block: "nearest"}) + } } else if (event.key === "Enter") { this.selectItem(this.filteredItems[this.selected].token) event.preventDefault() @@ -69,28 +80,38 @@