Skip to content

Conversation

@ariane-emory
Copy link
Owner

Summary

Implements GitHub issue #111: automatic list continuation in the prompt input textbox.

Behavior

  • When pressing Shift+Enter after a numbered list line like 1. foo bar, automatically inserts 2. on the new line
  • When pressing Shift+Enter on an empty list item like 3. (no content after marker), clears the line instead of continuing

Changes

  • New file: packages/opencode/src/cli/cmd/tui/component/list-continuation.ts - Core list continuation logic with useListContinuation() hook
  • New file: packages/opencode/test/cli/tui/list-continuation.test.ts - 29 unit tests covering all edge cases
  • Modified: packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx - Integrated list continuation into prompt component
  • Modified: packages/opencode/src/config/config.ts - Added linefeed to input_newline keybinding for terminal compatibility

Closes #111

When pressing newline on a numbered list line in the prompt input:
- If line has content (e.g., '1. foo'), inserts next number on new line
- If line is empty (e.g., '1. '), clears the list marker instead

This matches GitHub's behavior for list continuation in issues/PRs.

- Add list-continuation.ts with reusable hook and logic
- Add unit tests for list continuation functionality
- Integrate with prompt component's onKeyDown handler
- Add 'linefeed' to input_newline keybinding for terminal compatibility

Closes #111
@ariane-emory ariane-emory force-pushed the feat/automatic-list-continuation branch from 48bd957 to e89de51 Compare January 26, 2026 00:33
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.

[FEATURE]: Github-like automatic list continuation in prompt input textbox

2 participants