diff --git a/src/moepkg/editorstatus.nim b/src/moepkg/editorstatus.nim index da985bf08..c18f97987 100644 --- a/src/moepkg/editorstatus.nim +++ b/src/moepkg/editorstatus.nim @@ -92,7 +92,7 @@ proc initEditorStatus*(): EditorStatus = let useStatusBar = if result.settings.statusBar.useBar: 1 else: 0 result.mainWindow = initWindow(terminalHeight()-1, terminalWidth(), 0, 0) if result.settings.statusBar.useBar: - result.statusWindow = initWindow(1, terminalWidth(), terminalHeight() - useStatusBar - 1, 0, ui.ColorPair.blackGreen) + result.statusWindow = initWindow(1, terminalWidth(), terminalHeight() - useStatusBar - 1, 0, ui.ColorPair.blackPink) result.commandWindow = initWindow(1, terminalWidth(), terminalHeight()-1, 0) proc writeStatusBar*(status: var EditorStatus) = @@ -100,15 +100,15 @@ proc writeStatusBar*(status: var EditorStatus) = if status.mode == Mode.filer: if status.settings.statusBar.mode: status.statusWindow.write(0, 0, ru" FILER ", ui.ColorPair.blackWhite) - if status.settings.statusBar.directory: status.statusWindow.append(ru" ", ui.ColorPair.blackGreen) - status.statusWindow.append(getCurrentDir().toRunes, ui.ColorPair.blackGreen) + if status.settings.statusBar.directory: status.statusWindow.append(ru" ", ui.ColorPair.blackPink) + status.statusWindow.append(getCurrentDir().toRunes, ui.ColorPair.blackPink) status.statusWindow.refresh return if status.settings.statusBar.mode: status.statusWindow.write(0, 0, if status.mode == Mode.normal: ru" NORMAL " else: ru" INSERT ", ui.ColorPair.blackWhite) - status.statusWindow.append(ru" ", ui.ColorPair.blackGreen) - if status.settings.statusBar.filename: status.statusWindow.append(if status.filename.len > 0: status.filename else: ru"No name", ui.ColorPair.blackGreen) - if status.countChange > 0 and status.settings.statusBar.chanedMark: status.statusWindow.append(ru" [+]", ui.ColorPair.blackGreen) + status.statusWindow.append(ru" ", ui.ColorPair.blackPink) + if status.settings.statusBar.filename: status.statusWindow.append(if status.filename.len > 0: status.filename else: ru"No name", ui.ColorPair.blackPink) + if status.countChange > 0 and status.settings.statusBar.chanedMark: status.statusWindow.append(ru" [+]", ui.ColorPair.blackPink) let line = if status.settings.statusBar.line: fmt"{status.currentLine+1}/{status.buffer.len}" else: "" @@ -116,7 +116,7 @@ proc writeStatusBar*(status: var EditorStatus) = encoding = if status.settings.statusBar.characterEncoding: $status.settings.characterEncoding else: "" language = if status.language == SourceLanguage.langNone: "Plain" else: sourceLanguageToStr[status.language] info = fmt"{line} {column} {encoding} {language} " - status.statusWindow.write(0, terminalWidth()-info.len, info, ui.Colorpair.blackGreen) + status.statusWindow.write(0, terminalWidth()-info.len, info, ui.Colorpair.blackPink) status.statusWindow.refresh proc resize*(status: var EditorStatus, height, width: int) = diff --git a/src/moepkg/editorview.nim b/src/moepkg/editorview.nim index 92efabea6..7ac5251b1 100644 --- a/src/moepkg/editorview.nim +++ b/src/moepkg/editorview.nim @@ -189,7 +189,7 @@ proc writeAllLines*(view: var EditorView, win: var Window, lineNumber: bool, buf let isCurrentLine = view.originalLine[y] == currentLine if lineNumber and view.start[y] == 0: - view.writeLineNum(win, y, view.originalLine[y], if isCurrentLine: ColorPair.brightGreenDefault else: ColorPair.grayDefault) + view.writeLineNum(win, y, view.originalLine[y], if isCurrentLine: ColorPair.pinkDefault else: ColorPair.grayDefault) var x = view.widthOfLineNum if view.length[y] == 0: @@ -203,7 +203,7 @@ proc writeAllLines*(view: var EditorView, win: var Window, lineNumber: bool, buf last = min(highlight[i].lastColumn-view.start[y], view.lines[y].high) assert(0 <= first and last <= view.lines[y].high and first <= last, fmt"first = {first}, last = {last}, firstColumn = {highlight[i].firstColumn}, lastColumn = {highlight[i].lastColumn}, view.start[y] = {view.start[y]}, y = {y}, view.lines[y] = {view.lines[y]}, view.originalLine[y] = {view.originalLine[y]}") let str = view.lines[y][first .. last] - view.write(win, y, x, str, if isCurrentLine: ColorPair.brightGreenDefault else: highlight[i].color) + view.write(win, y, x, str, highlight[i].color) x += width(str) if last == highlight[i].lastColumn - view.start[y]: # consumed a whole segment diff --git a/src/moepkg/ui.nim b/src/moepkg/ui.nim index fbd19e1bd..e2708df25 100644 --- a/src/moepkg/ui.nim +++ b/src/moepkg/ui.nim @@ -18,8 +18,9 @@ type Color* = enum magenta = 5, cyan = 6, white = 7, - lightBlue = 14 + lightBlue = 14, brightGreen = 85, + pink = 198, brightWhite = 231, gray = 245, @@ -37,6 +38,8 @@ type ColorPair* = enum whiteCyan = 11 magentaDefault =12 whiteDefault = 13 + pinkDefault = 14 + blackPink = 15 type Window* = object cursesWindow*: ptr window @@ -63,6 +66,8 @@ proc setCursesColor() = setColorPair(ColorPair.whiteCyan, Color.white, Color.cyan) setColorPair(ColorPair.magentaDefault, Color.magenta, Color.default) setColorPair(ColorPair.whiteDefault, Color.white, Color.default) + setColorPair(ColorPair.pinkDefault, Color.pink, Color.default) + setColorPair(ColorPair.blackPink, Color.black, Color.pink) proc setIbeamCursor*() = discard execShellCmd("printf '\\033[6 q'")