File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,6 +291,28 @@ func (t tui) renderTuido(item tuido.Item, width int) string {
291291 ret = strings .ReplaceAll (ret , "#" + tag .String (), t .tagColors [tag .Name ()].Render ("#" + tag .String ()))
292292 }
293293
294+ if imp := item .Importance (); imp > 0 {
295+ var exclamStyle lg.Style
296+ switch {
297+ case imp >= 5 :
298+ exclamStyle = lg .NewStyle ().Bold (true ).Foreground (lg .Color ("#ffffff" )).Background (lg .Color ("#ff2222" )).Blink (true )
299+ case imp == 4 :
300+ exclamStyle = lg .NewStyle ().Bold (true ).Foreground (lg .Color ("#ffffff" )).Background (lg .Color ("#ff2222" ))
301+ case imp == 3 :
302+ exclamStyle = lg .NewStyle ().Bold (true ).Foreground (lg .Color ("#ff2222" ))
303+ case imp == 2 :
304+ exclamStyle = lg .NewStyle ().Bold (true ).Foreground (lg .Color ("#ff4444" ))
305+ default :
306+ exclamStyle = lg .NewStyle ().Bold (true ).Foreground (lg .Color ("#ff8866" ))
307+ }
308+ text := ret [4 :]
309+ prefixLen := 0
310+ for prefixLen < len (text ) && (text [prefixLen ] == '.' || text [prefixLen ] == '!' ) {
311+ prefixLen ++
312+ }
313+ ret = ret [:4 ] + exclamStyle .Render (text [:prefixLen ]) + text [prefixLen :]
314+ }
315+
294316 // +2 here because of the leading 'cursor' space
295317 if len (ret )+ 2 > width {
296318 rowsRequired := (len (ret ) - 4 ) / (width - 6 ) // -6 here instead of 4 because of the cursor spaces
You can’t perform that action at this time.
0 commit comments