Skip to content

Commit

Permalink
Add extensive logs for help in debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
lazysegtree committed Feb 4, 2025
1 parent 1d7f705 commit 8adf2cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/internal/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (m model) Init() tea.Cmd {
// Update function for bubble tea to provide internal communication to the
// application
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
slog.Debug("model.Update() called. ", "current width", m.fullWidth,
"current height", m.fullHeight)
var cmd tea.Cmd

switch msg := msg.(type) {
Expand Down Expand Up @@ -95,6 +97,7 @@ func (m *model) handleChannelMessage(msg channelMessage) {

// Adjust window size based on msg information
func (m *model) handleWindowResize(msg tea.WindowSizeMsg) {
slog.Debug("model.Update() called with handleWindowResize msg.", "msg.Width", msg.Width, "msg.Height", msg.Height)
m.fullHeight = msg.Height
m.fullWidth = msg.Width

Expand Down Expand Up @@ -296,6 +299,7 @@ func (m *model) warnModalForQuit() {

// Implement View function for bubble tea model to handle visualization.
func (m model) View() string {
slog.Debug("model.View() called.", "h", m.fullHeight, "w", m.fullWidth)
panel := m.fileModel.filePanels[m.filePanelFocusIndex]
// check is the terminal size enough
if m.fullHeight < minimumHeight || m.fullWidth < minimumWidth {
Expand Down

0 comments on commit 8adf2cb

Please sign in to comment.