Skip to content

Update UI elements and fix cursor positioning #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qasimsk20
Copy link

Summary

  • Replace ASCII art header with cleaner design
  • Fix cursor positioning after menu draw to ensure proper navigation
  • Update menu position to top for better layout

Changes Made

  1. Updated ASCII art in lua/leetcode-ui/lines/menu-header.lua to use cleaner design
  2. Fixed cursor positioning in lua/leetcode-ui/renderer/menu.lua to ensure proper navigation after menu draw
  3. Menu position updated to "top" for better layout

Technical Details

Cursor Positioning Fix

Added code after Menu.super.draw(self, self) to ensure proper cursor positioning:

-- After drawing, ensure cursor is at the first item and prev is set
local row = self._.buttons[self.cursor.idx] and self._.buttons[self.cursor.idx].line_idx or 1
local col = #vim.fn.getline(row):match("^%s*")
self.cursor.prev = { row, col }
vim.api.nvim_win_set_cursor(self.winid, self.cursor.prev)

ASCII Art Update

Replaced complex ASCII art with cleaner, more readable design.

Testing Instructions

  • Test that the new ASCII art displays correctly
  • Verify cursor positioning works properly after menu interactions
  • Ensure menu layout is properly positioned at the top
  • Test all menu functionality remains intact

🤖 Generated with opencode

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.

1 participant