Skip to content

Conversation

@lambdalisue
Copy link
Member

Summary

Adds support for the -input= option to pre-fill the picker's prompt with an initial query value.

Changes

  • New utility module: denops/fall/util/args.ts

    • parseArgs(): Parse command-line arguments with quote and escape support
    • extractOption(): Extract option arguments by prefix
    • Comprehensive tests (20 test cases)
  • Updated picker:command handler: denops/fall/main/picker.ts

    • Extract -input= option from arguments before source name
    • Create initial PickerContext with query when specified
    • Options after source name are treated as source arguments
  • Command syntax change: plugin/fall.vim

    • Use <q-args> instead of <f-args> to support quoted arguments
  • Documentation: doc/fall.txt

    • Updated command syntax: :Fall [-input={value}] {source} [{cmdarg}...]
    • Added usage examples and constraints
    • Clarified that -input= must appear before source name

Usage Examples

" Set initial prompt value
:Fall -input="Hello world" file

" Combine with source arguments
:Fall -input="search term" grep /path/to/dir

" Invalid: option after source (treated as source argument)
:Fall file -input="test"

Test Coverage

  • 15 unit tests for parseArgs() and extractOption()
  • 5 integration tests for picker:command specification
  • All tests passing ✅
  • Type checks passing ✅

Breaking Changes

None. This is a backward-compatible feature addition.

@lambdalisue lambdalisue force-pushed the feat/add-input-option branch from d8957b7 to 4d64c53 Compare October 17, 2025 20:03
@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.84%. Comparing base (abf9c78) to head (cdb92c5).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
+ Coverage   83.45%   83.84%   +0.38%     
==========================================
  Files          31       32       +1     
  Lines        1977     2024      +47     
  Branches      200      214      +14     
==========================================
+ Hits         1650     1697      +47     
  Misses        324      324              
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add support for the -input= option to pre-fill the picker's prompt
with an initial query. This is useful for starting searches with a
predefined term.

Usage:
  :Fall -input="search term" file

The -input= option must appear before the source name. Options placed
after the source name are treated as source arguments.

Changes:
- Add parseArgs() and extractOption() utilities in util/args.ts
- Update picker:command to extract and process -input= option
- Use <q-args> instead of <f-args> to support quoted arguments
- Add comprehensive tests (20 test cases)
- Update documentation with usage examples and constraints
@lambdalisue lambdalisue force-pushed the feat/add-input-option branch from 4d64c53 to cdb92c5 Compare October 17, 2025 20:06
@lambdalisue lambdalisue merged commit abfe3b7 into main Oct 18, 2025
6 checks passed
@lambdalisue lambdalisue deleted the feat/add-input-option branch October 18, 2025 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants