Skip to content

Commit

Permalink
fix: maintain library scroll position when toggling namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jahvon committed Sep 28, 2024
1 parent 355db8b commit 7aa8465
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/io/library/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (l *Library) Init() tea.Cmd {
l.paneTwoViewport.Init(),
)

if l.ctx.TUIContainer.Width() >= 100 {
if l.ctx.TUIContainer.Width() >= 150 {
l.splitView = true
}
l.setSize()
Expand Down
1 change: 1 addition & 0 deletions internal/io/library/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var (
func (l *Library) View() string {
l.paneZeroViewport.Style = paneStyle(0, l.theme, l.splitView)
l.paneZeroViewport.SetContent(l.paneZeroContent())
l.paneZeroViewport.SetYOffset(int(l.currentWorkspace + l.currentNamespace))

Check failure on line 44 in internal/io/library/view.go

View workflow job for this annotation

GitHub Actions / validate

G115: integer overflow conversion uint -> int (gosec)

l.paneOneViewport.Style = paneStyle(1, l.theme, l.splitView)
l.paneOneViewport.SetContent(l.paneOneContent())
Expand Down

0 comments on commit 7aa8465

Please sign in to comment.