File tree 2 files changed +25
-5
lines changed
2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ Use the Pomodoro Technique in Neovim with built-in session tracking and break re
32
32
opts = function (_ , opts )
33
33
table.insert (opts .sections .lualine_x , 3 , {
34
34
function ()
35
- return require (" pomodoro" ).get_pomodoro_status ()
35
+ return require (" pomodoro" ).get_pomodoro_status (" 🍅❌ " , " 🍅 " , " ☕ " )
36
36
end ,
37
37
})
38
38
end ,
Original file line number Diff line number Diff line change @@ -43,18 +43,38 @@ function pomodoro.startTimer(time, fn)
43
43
pomodoro .timer :start (time , 0 , fn )
44
44
end
45
45
46
- function pomodoro .get_pomodoro_status ()
46
+ --- @param not_running_phase ? string
47
+ --- @param running_phase ? string
48
+ --- @param break_phase ? string
49
+ --- @return string
50
+ function pomodoro .get_pomodoro_status (
51
+ not_running_phase ,
52
+ running_phase ,
53
+ break_phase
54
+ )
47
55
local time_left = pomodoro .timer_duration
48
56
- (uv .now () - pomodoro .started_timer_time )
49
57
50
58
local phase_str = " "
51
59
if pomodoro .phase == Phases .NOT_RUNNING then
52
- phase_str = " 🍅❌"
60
+ if not_running_phase then
61
+ phase_str = not_running_phase
62
+ else
63
+ phase_str = " 🍅❌"
64
+ end
53
65
time_left = 0
54
66
elseif pomodoro .phase == Phases .RUNNING then
55
- phase_str = " 🍅"
67
+ if running_phase then
68
+ phase_str = running_phase
69
+ else
70
+ phase_str = " 🍅"
71
+ end
56
72
elseif pomodoro .phase == Phases .BREAK then
57
- phase_str = " ☕"
73
+ if break_phase then
74
+ phase_str = break_phase
75
+ else
76
+ phase_str = " ☕"
77
+ end
58
78
end
59
79
60
80
local minutes = math.floor (time_left / 60000 )
You can’t perform that action at this time.
0 commit comments