Skip to content

refactor(tab_strip): improve readability#220

Merged
Tieske merged 15 commits intolunarmodules:mainfrom
MohamedAmr26:main
Mar 22, 2026
Merged

refactor(tab_strip): improve readability#220
Tieske merged 15 commits intolunarmodules:mainfrom
MohamedAmr26:main

Conversation

@MohamedAmr26
Copy link
Copy Markdown
Contributor

Extract helper functions for item processing, option validation, viewport state management, and tab line rendering. Add _get_selected_index to eliminate repeated lookup loops. Combine defaults into default_config and move constants to module level.

@MohamedAmr26 MohamedAmr26 mentioned this pull request Mar 14, 2026
Copy link
Copy Markdown
Member

@Tieske Tieske left a comment

Choose a reason for hiding this comment

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

Nice PR. Some comments though.

Copy link
Copy Markdown
Member

@Tieske Tieske left a comment

Choose a reason for hiding this comment

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

only had little time, so didn't fully review

@Tieske
Copy link
Copy Markdown
Member

Tieske commented Mar 15, 2026

This PR has merge conflicts since I merged another refactor. But would love to see a rebase, since this one also has a lot of nice refactors.

end

build_cache(self)
self:_build_cache()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

here we are reintroducing a method, I'd prefer to stick to the local function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

why in ur opinion do you think sticking to local functions in the two methods I merge is prefered?

MohamedAmr26 and others added 15 commits March 22, 2026 09:29
Extract helper functions for item processing, option validation, viewport state management, and tab line rendering. Add _get_selected_index to eliminate repeated lookup loops. Combine defaults into default_config and move constants to module level.
Typing rules mistakes fix, functions are lua-ish style
Remove some extractions that reduces the readability
Co-authored-by: Thijs Schreijer <thijs@thijsschreijer.nl>
ellipsis_width is the dynamically determine variable
Co-authored-by: Thijs Schreijer <thijs@thijsschreijer.nl>
Copy link
Copy Markdown
Member

@Tieske Tieske left a comment

Choose a reason for hiding this comment

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

@MohamedAmr26 pushed some updates myself. This is now good to go. Thx!

@Tieske Tieske changed the title refactor (tab_strip): improve readability refactor(tab_strip): improve readability Mar 22, 2026
@Tieske Tieske merged commit 09c2343 into lunarmodules:main Mar 22, 2026
8 checks passed
@MohamedAmr26
Copy link
Copy Markdown
Contributor Author

Alright, Thanks for mentoring!

Gitkbc pushed a commit to Gitkbc/terminal.lua that referenced this pull request Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants