Skip to content

feat: add :w and :write actions to send the prompt - #60

Merged
oribarilan merged 5 commits into
oribarilan:mainfrom
Croos3r:feat/colon-w-send-prompt
Aug 23, 2026
Merged

oribarilan merged 5 commits into
oribarilan:mainfrom
Croos3r:feat/colon-w-send-prompt

Conversation

@Croos3r

@Croos3r Croos3r commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Implementation of the :w and :write actions:

I did not added any tests because :wq was not tested, but I can add some if needed.

The old behavior documented in #59 is now replaced by an exact match with :w so the frustrating :wq cannot be accessed like this.

I took the initiative to update the changelog, but feel free to update it if needed, I can also do it on your instructions.

Croos3r added 5 commits July 28, 2026 14:12
Previously typing :w in the command palette autocompleted to :wq and
quit OpenCode. Vim users hit :w reflexively to save, so map it to the
closest equivalent here: dispatch input.submit. :write is the long form.

The :wq quit command is unaffected.
Copilot AI review requested due to automatic review settings July 28, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Croos3r Croos3r mentioned this pull request Jul 28, 2026
@oribarilan

Copy link
Copy Markdown
Owner

@Croos3r I was away on a vacation and only got to this now, sorry for the delay. This looks great, Thanks for the contribution!

@oribarilan
oribarilan merged commit f708699 into oribarilan:main Aug 23, 2026
1 check passed
@Croos3r
Croos3r deleted the feat/colon-w-send-prompt branch August 25, 2026 13:03
oribarilan added a commit that referenced this pull request Aug 31, 2026
index.ts 395->408 after the :w/:write merge (#60); types/state/normal drift from the pending-state consolidation.
oribarilan added a commit that referenced this pull request Sep 1, 2026
Splits the monolithic `src/vim.ts` (656 lines) into a focused `src/vim/`
module tree behind a thin barrel, with tests split to mirror the layout.
Rebased on v0.16.0.

### What changed

- **Module split:** `src/vim.ts` becomes `src/vim/` with one concern per
file: `types`, `text`, `tables`, `util`, `state`, `insert`, `normal`,
`visual`, plus an `index.ts` barrel that re-exports only the public
surface. Handlers stay pure; nothing under `src/vim/` touches the plugin
`api`.
- **Pending state:** consolidated the two pending-state fields into a
single discriminated union. This also fixes a bug where `dgg` and `drx`
left a dangling delete operator that corrupted the next motion.
- **Tests:** `test/vim.test.ts` split into per-module suites under
`test/vim/`, plus a new `test/integration.test.ts` for the full
pipeline.
- **Docs:** added the modularization and text-objects design notes under
`docs/plans/`, and updated AGENTS.md to describe the new layout.

### Behavior

No user-facing behavior change beyond the dangling-operator fix. The
`:w`/`:write` feature from #60 is untouched (it lives in `src/index.ts`,
outside the engine).

### Verification

`just check` passes locally: lint clean (24 files), 209 tests, 0 fail.
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.

3 participants