Allow left/right for collapse, more hotkeys

* Use 'b' to toggle fold icon before/after key
* Use 'g' to toggle indentation guide lines
* Cosmetic fixes
This commit is contained in:
2024-10-03 15:29:56 +02:00
parent f023de0198
commit ddfefa124b
4 changed files with 77 additions and 9 deletions

View File

@@ -8,12 +8,20 @@ class Settings
public static bool $compactGroups = false;
public static bool $indentationGuides = true;
public static bool $collapseBefore = true;
public static bool $highlightRow = true;
public static function load(string $filename): void
{
if (file_exists($filename) && is_readable($filename)) {
$data = json_decode(file_get_contents($filename));
self::$editorQuotedKeys = $data->editorQuotedKeys ?? false;
self::$compactGroups = $data->compactGroups ?? false;
self::$indentationGuides = $data->indentationGuides ?? true;
self::$collapseBefore = $data->collapseBefore ?? true;
}
}
@@ -22,6 +30,9 @@ class Settings
$data = json_encode([
'editorQuotedKeys' => self::$editorQuotedKeys,
'compactGroups' => self::$compactGroups,
'indentationGuides' => self::$indentationGuides,
'collapseBefore' => self::$collapseBefore,
'highlightRow' => self::$highlightRow,
], JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)."\n";
@file_put_contents($filename, $data);
}