From ab399f77e9931cbc0430dced566e29ef416066b9 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Thu, 3 Oct 2024 18:05:34 +0200 Subject: [PATCH] Bugfix message styling, save tailLine setting --- src/Editor/Editor.php | 8 +++++++- src/Settings.php | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Editor/Editor.php b/src/Editor/Editor.php index 3a80a3b..903eefa 100644 --- a/src/Editor/Editor.php +++ b/src/Editor/Editor.php @@ -254,6 +254,12 @@ class Editor $this->redrawEditor(); $this->showMessage("Toggle collapse icon before item (b)"); break; + + case "t": + Settings::$tailLine = !Settings::$tailLine; + $this->redrawEditor(); + $this->showMessage("Toggle tail line (t)"); + break; case "+": $node = $this->list->getNodeForIndex($this->currentRow); @@ -840,7 +846,7 @@ class Editor { [$w,$h] = $this->term->getSize(); $this->term->setCursor(1, $h); - echo $message."\e[K\e[0m"; + echo "\e[0m".$message."\e[K\e[0m"; } diff --git a/src/Settings.php b/src/Settings.php index 3383cc9..d0294a8 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -24,6 +24,7 @@ class Settings self::$compactGroups = $data->compactGroups ?? false; self::$indentationGuides = $data->indentationGuides ?? true; self::$collapseBefore = $data->collapseBefore ?? true; + self::$tailLine = $data->tailLine ?? true; } } @@ -35,6 +36,7 @@ class Settings 'indentationGuides' => self::$indentationGuides, 'collapseBefore' => self::$collapseBefore, 'highlightRow' => self::$highlightRow, + 'tailLine' => self::$tailLine, ], JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)."\n"; @file_put_contents($filename, $data); }