@@ -16,6 +16,7 @@ local Phases = constants.Phases
1616--- @field start_at_launch boolean
1717--- @field timer uv_timer_t
1818--- @field phase integer
19+ --- @field display_ui_on_break boolean
1920local pomodoro = {}
2021
2122-- Work duration in ms
@@ -33,6 +34,7 @@ pomodoro.start_at_launch = true
3334pomodoro .timer = uv .new_timer ()
3435pomodoro .started_timer_time = uv .now ()
3536pomodoro .phase = Phases .NOT_RUNNING
37+ pomodoro .display_ui_on_break = true
3638
3739--- @param time number
3840--- @param fn function
@@ -125,7 +127,9 @@ function pomodoro.startBreak(forced_time)
125127 end
126128
127129 info (" Break of " .. break_duration / MIN_IN_MS .. " m started!" )
128- vim .schedule (pomodoro .displayPomodoroUI )
130+ if pomodoro .display_ui_on_break then
131+ vim .schedule (pomodoro .displayPomodoroUI )
132+ end
129133 pomodoro .startTimer (break_duration , pomodoro .endBreak )
130134end
131135
205209--- @field delay_duration ? number
206210--- @field breaks_before_long ? number
207211--- @field start_at_launch ? boolean
212+ --- @field display_ui_on_break ? boolean
208213
209214--- @param opts PomodoroOpts
210215function pomodoro .setup (opts )
@@ -227,6 +232,9 @@ function pomodoro.setup(opts)
227232 if opts .start_at_launch ~= nil then
228233 pomodoro .start_at_launch = opts .start_at_launch
229234 end
235+ if opts .display_ui_on_break ~= nil then
236+ pomodoro .display_ui_on_break = opts .display_ui_on_break
237+ end
230238 end
231239
232240 pomodoro .registerCmds ()
0 commit comments