mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-09-16 05:36:10 +00:00
Color message bar messages
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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 = "[???] "
|
||||
|
||||
Reference in New Issue
Block a user