fix: Firefox clipboard, flip dropdown default to normal mode
- Replace Vim.map("...", "\"+...", ...) with custom Vim.defineAction
handlers calling navigator.clipboard directly. The library's "+"
register implementation doesn't reliably write on Firefox.
Limitation: only yy/Y/visual-y reach system clipboard; bare
y<motion> still uses vim's internal register.
- Flip dropdown modal: default NORMAL (j/k arrows), `/` or `i`
enters search. Listener moved to document capture phase so closed
dropdowns receive keydown on Firefox.
This commit is contained in:
13
CHANGELOG.md
13
CHANGELOG.md
@@ -10,13 +10,12 @@ Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
### Added
|
||||
- Vim bindings in the input via CodeMirror 6 + `@replit/codemirror-vim` (loaded from esm.sh, no build step). Supports `i`/`Esc`, `hjkl`, word/line motions, `dd`/`yy`/`p`, undo/redo, `/` search, `:` command line. Auto-disabled on touch devices (detected via `(pointer: coarse)`) where modal editing fights the virtual keyboard.
|
||||
- `Shift-H` / `Shift-L` cycle focus across the page controls (source → target → model → editor → button) like `Shift-Tab` / `Tab`. Also overridden in vim normal mode (replacing vim's viewport-top/bottom default) so the same shortcut works to leave the editor.
|
||||
- `y` / `Y` / `yy` and visual-mode `y` in the editor now copy to the system clipboard via vim's `+` register (synchronous `document.execCommand("copy")` under the hood — no permission prompt).
|
||||
- `p` / `P` in vim normal mode paste from the system clipboard at / before the cursor via the same `+` register. The first paste may show a one-time browser permission chip; granting clipboard-read on the origin makes future calls silent.
|
||||
- Vim-style modal navigation on the From / To / Model dropdowns:
|
||||
- Default is native typeahead search (type letters to filter)
|
||||
- `Esc` enters normal mode; an accent-coloured border indicates this
|
||||
- In normal mode, `j` / `k` move selectedIndex down / up
|
||||
- `i` or `/` returns to search mode; blur also resets so the next focus starts in search
|
||||
- `yy` / `Y` and visual-mode `y` in the editor copy to the system clipboard via custom `navigator.clipboard.writeText()` actions (the library's `+` register is broken on Firefox). Bare `y<motion>` (e.g. `yw`, `y$`) still uses vim's internal register — that path would need a deeper hook into the library's register system.
|
||||
- `p` / `P` in vim normal mode paste from the system clipboard at / before the cursor via `navigator.clipboard.readText()`. Browsers may show a one-time permission prompt or chip; granting clipboard-read for the origin makes future calls silent. On Firefox, ensure `dom.events.asyncClipboard.readText` is `true` (default in recent versions) or the read will be blocked.
|
||||
- Vim-style modal navigation on the From / To / Model dropdowns (default NORMAL):
|
||||
- `j` / `k` move selectedIndex down / up (works whether the dropdown is open or collapsed; uses document-level capture-phase listener so Firefox plays along)
|
||||
- `/` or `i` enters search mode — letter keys then do native typeahead; accent-coloured border indicates it
|
||||
- `Esc` returns to normal mode; blur also resets so the next focus starts in normal
|
||||
- On page load, the model dropdown defaults to whichever model Ollama already has hot — skips the 5-15 s disk-reload pain on the first translation. After load it follows the user's manual selection.
|
||||
|
||||
### Changed
|
||||
|
||||
Reference in New Issue
Block a user