github saberzero1/motions 0.42.0

latest releases: 1.4.0, 1.3.1, 1.3.0...
3 months ago

Added

  • Mobile opt-in setting and toggle command — the plugin is now disabled by default on mobile devices. A new enableOnMobile setting (default: off) controls whether the plugin activates on mobile. When disabled, the plugin skips all Vim engine initialization — no editor extensions, event listeners, commands, or status bar elements are registered — leaving Obsidian's editor in its default state. The settings tab and a toggle command (Vim Motions: Toggle enable on mobile) remain accessible even when the plugin is disabled, so users can re-enable without needing a desktop device. Changing the setting requires an Obsidian reload. Hardware keyboard users on tablets can opt in; soft-keyboard-only users are no longer stuck in Normal mode with no way to escape. (#52)
    • Plugin: src/settings.ts (enableOnMobile in VimMotionsSettings interface, DEFAULT_SETTINGS, getSettingDefinitions() Mobile group, display() Mobile toggle), src/main.ts (early return in onload() when Platform.isMobile && !enableOnMobile, toggle-enable-on-mobile command registered before the gate)
  • showConfigNotifications setting — a new toggle in Settings → Vim Motions → Vimrc & key bindings → Show config load notifications (default: on) controls whether the plugin shows Obsidian Notice popups when vimrc or init.lua files are loaded on startup. When disabled, success and informational notifications ("loaded N commands from …", "loaded but contained no commands", "no config files found") are suppressed. Error notifications (lua syntax/runtime errors) and single-mode "not found" warnings (e.g. configMode is lua but no init.lua exists) always show regardless of this setting.
    • Plugin: src/settings.ts (showConfigNotifications in VimMotionsSettings interface, DEFAULT_SETTINGS, toggle in Vimrc & key bindings group), src/main.ts (notification gating in vimrc loading, lua loading, and dual-mode fallback)

Changed

  • Config load notifications scoped and improved — startup notifications for vimrc and init.lua loading are now better scoped. "Not found" messages only appear when the specific config type is the sole configured mode (e.g. configMode is vimrc but no vimrc exists) and now include the searched path. In dual-mode (lua-vimrc), "no config files found" lists both searched paths. Success and empty-file notifications respect the new showConfigNotifications setting. Error notifications (lua parse/runtime errors) always show.
    • Plugin: src/main.ts (vimrc notification block, lua notification block, dual-mode fallback notification)
  • Picker preview pane renders markdown — picker preview windows now render file content through Obsidian's MarkdownRenderer.render() instead of displaying raw markdown text in <pre><code> blocks. Headings, bold, italic, code blocks, images, links, callouts, and other markdown formatting are fully rendered. Links inside the preview are non-interactive (click-through disabled via pointer-events: none). For positional previews (grep, live grep, headings, marks), the rendered markdown is displayed alongside a line-number gutter that highlights the target line. Component lifecycle is managed per preview update (load() on render, unload() on preview change and modal close) to prevent memory leaks. Plain-string previews (commands, registers) remain unchanged. The picker modal now uses a fixed height (50vh) to prevent layout shifts when switching between files, and the result count element reserves its line height when empty.
    • Plugin: src/picker/picker.ts (renderMarkdownPreview method, Component lifecycle, PreviewResult dispatch), src/picker/types.ts (PreviewResult interface, PreviewReturn union type), src/picker/sources/preview-utils.ts (returns PreviewResult with sourcePath and optional lineRange), styles.css (rendered preview content, positional gutter, fixed modal height)

Fixed

  • Cursor-aware table widget does not render inline markdown — images, bold, italic, math, links, and other inline formatting inside table cells were displayed as plain text when the cursor-aware table widget was active. The TableRenderWidget used textContent to populate cells, which strips all markup. Replaced with MarkdownRenderer.render() to process cell content through Obsidian's markdown pipeline. Plain text is shown instantly as a fallback while the async render completes. The <p> wrapper added by MarkdownRenderer is unwrapped to avoid block-level spacing in cells. Component lifecycle is managed per widget (load() in toDOM, unload() in destroy) to prevent memory leaks. editorInfoField provides app and sourcePath from the editor state for correct relative image path resolution. (#50)
    • Plugin: src/vim/table-render-widget.ts (renderCell function, MarkdownRenderer.render() integration, Component lifecycle, editorInfoField for app/sourcePath access)
  • :obcommand unavailable in Lua-only config mode — vim.cmd('obcommand ...') failed with "Not an editor command" when configMode was set to lua (without vimrc). The obcommand ex command was only registered inside registerVimrcExCommands(), which only runs when vimrc loading is enabled. Moved obcommand registration to registerObCommand() alongside ob, sharing the same handler. Both commands are now available in all config modes (lua, vimrc, lua-vimrc, settings-only). Additionally, :obcommand with no arguments now opens the command picker (matching :ob behavior) instead of silently doing nothing.
    • Plugin: src/workspace/commands.ts (registerObCommand registers both ob and obcommand), src/vimrc/loader.ts (removed duplicate obcommand registration and unused executeCommandById helper)

Documentation

  • docs/configuration/settings.md: added Mobile section with enableOnMobile setting; added showConfigNotifications toggle to Vimrc & key bindings table
  • docs/getting-started/installation.md: added Mobile section with enable instructions
  • KNOWN_LIMITATIONS.md: updated Mobile support section with opt-in setting, toggle command, and revised platform feature table; added config load notification scoping section under Config file resolution
  • 7 new e2e tests — config-notifications.e2e.ts covering: lua loaded notification shown/suppressed, lua error notification always shown even when suppressed, lua empty-file notification shown/suppressed, notification includes config file path, setting default verification
  • Shared test helpers — setPluginSetting, getNotices, getVimMotionsNotices, dismissNotices added to test/helpers.ts

Full Changelog: 0.41.0...0.42.0

Don't miss a new motions release

NewReleases is sending notifications on new releases.