Small fixes

This commit is contained in:
Maddie H 2022-04-15 16:38:39 +01:00
parent b5553440fc
commit 2cde5fa49f
2 changed files with 14 additions and 12 deletions

View File

@ -7,7 +7,7 @@ class StatusBar:
self.mode = instance.mode.upper()
self.file = instance.buffer.name or "[No Name]"
self.icon = instance.config["icon"] or "λ"
self.theme = "inverted"
self.theme = "default"
self.colors = [7, 5, 13]
self.components = [self.icon, self.mode, self.file]
@ -23,6 +23,16 @@ class StatusBar:
self.update(instance)
if self.theme == "inverted":
# Initialise the x position for each component
x = 1
# Render each component
for count, component in enumerate(self.components):
instance.screen.addstr(instance.height - 2, x, component,
curses.color_pair(self.colors[count]) | curses.A_BOLD)
x += len(component) + 1
else:
# Initialise temporary colors for inverted theme
colors = []
@ -33,8 +43,9 @@ class StatusBar:
# Initialise the x position for each component
x = 0
# Render each component
for count, component in enumerate(self.components):
component = " " + component + " "
component = f" {component} "
instance.screen.addstr(instance.height - 2, x, component,
curses.color_pair(colors[count]) | curses.A_BOLD)
x += len(component)
@ -42,15 +53,6 @@ class StatusBar:
# Add a space at the end of the status bar
instance.screen.addstr(instance.height - 2, x, " " * (instance.width - x),
curses.color_pair(2))
else:
# Initialise the x position for each component
x = 1
# Render each component
for count, component in enumerate(self.components):
instance.screen.addstr(instance.height - 2, x, component,
curses.color_pair(self.colors[count]) | curses.A_BOLD)
x += len(component) + 1
class Components:

View File

@ -15,7 +15,7 @@ def activate(instance, mode):
elif mode == "insert":
# Activate insert mode
instance.components.components["bottom"][0].colors[1] = 9
instance.components.components["bottom"][0].colors[1] = 11
insert.activate()
elif mode == "normal":