Skip to content

Conversation

@epheien
Copy link
Contributor

@epheien epheien commented Jan 13, 2026

Summary

  • Simplified the select rendering logic in lua/opencode/ui/select.lua
  • Removed unnecessary indentation calculations that were causing alignment issues
  • The change makes the code cleaner and more maintainable

Changes

  • Removed the indent variable calculation based on item index
  • Simplified group divider rendering to remove unnecessary spacing
  • Simplified regular item formatting to remove the leading spacing

This refactoring improves the visual alignment of the select UI and reduces code complexity.

For example, when using dressing+telescope as the implementation of vim.ui.select, this situation occurs.

Xnip2026-01-13_03-00-44

@NickvanDyke
Copy link
Owner

Ah, well this indentation is for the default vim.ui.select because it prepends the index number to each row. But I forgot about other vim.ui.select replacements. I wonder how we could only do this for the former case 🤔

@epheien
Copy link
Contributor Author

epheien commented Jan 13, 2026

Ah, well this indentation is for the default vim.ui.select because it prepends the index number to each row. But I forgot about other vim.ui.select replacements. I wonder how we could only do this for the former case 🤔

I know the purpose of doing it that way. What I mean is, if it's using the native vim.ui.select, then there's no need for padding, because it's hard to tell whether vim.ui.select is using the native one or another substitute.

@epheien
Copy link
Contributor Author

epheien commented Jan 13, 2026

I choose to modify the dressing code to solve this alignment issue.

@epheien epheien closed this Jan 13, 2026
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