Color message bar messages

This commit is contained in:
2026-05-19 17:12:54 +03:00
parent 5af962c6b2
commit 01bc6702a9
3 changed files with 11 additions and 0 deletions
+1
View File
@@ -6,5 +6,6 @@ selected_style_fallback: "default-fallback" # Style for 8-color capable terminal
show_top_menu: true
show_line_index: true
extend_line_index: false # Extend line index to the bottom of the screen
color_message_bar: true # Add color to message bar messages
buffer_info_message: "File: %f, Filetype: %t, Cursor: (%x, %y, %p), Chars: %c"
tab_indentation: 4 # Length of tab characters
+1
View File
@@ -12,6 +12,7 @@ type TyperConfig struct {
FallbackStyle string `yaml:"fallback_style,omitempty"`
ShowTopMenu bool `yaml:"show_top_menu,omitempty"`
ShowLineIndex bool `yaml:"show_line_index,omitempty"`
ColorMessageBar bool `yaml:"color_message_bar"`
ExtendLineIndex bool `yaml:"extend_line_index,omitempty"`
BufferInfoMessage string `yaml:"buffer_info_message,omitempty"`
TabIndentation int `yaml:"tab_indentation,omitempty"`
+9
View File
@@ -82,10 +82,19 @@ func drawMessageBar(window *Window) {
if lastMessage != nil && time.Since(time.UnixMilli(lastMessage.Timestamp)).Seconds() < 5 {
switch lastMessage.Urgency {
case TYPER_MESSAGE_INFO:
if Config.ColorMessageBar {
messageBarStyle = messageBarStyle.Foreground(CurrentStyle.SyntaxInfo)
}
messageToPrint = "[INFO] "
case TYPER_MESSAGE_WARNING:
if Config.ColorMessageBar {
messageBarStyle = messageBarStyle.Foreground(CurrentStyle.SyntaxWarning)
}
messageToPrint = "[WARNING] "
case TYPER_MESSAGE_ERROR:
if Config.ColorMessageBar {
messageBarStyle = messageBarStyle.Foreground(CurrentStyle.SyntaxError)
}
messageToPrint = "[ERROR] "
default:
messageToPrint = "[???] "