@fresh-editor/fresh-editor 0.2.22 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/package.json +1 -1
- package/plugins/audit_mode.i18n.json +141 -379
- package/plugins/audit_mode.ts +1078 -451
- package/plugins/config-schema.json +146 -0
- package/plugins/git_explorer.ts +7 -7
- package/plugins/lib/fresh.d.ts +25 -2
- package/plugins/pkg.ts +151 -397
- package/plugins/theme_editor.i18n.json +182 -14
- package/plugins/theme_editor.ts +192 -85
|
@@ -42,6 +42,24 @@
|
|
|
42
42
|
"menu_bar_mnemonics": true,
|
|
43
43
|
"show_tab_bar": true,
|
|
44
44
|
"show_status_bar": true,
|
|
45
|
+
"status_bar": {
|
|
46
|
+
"left": [
|
|
47
|
+
"{filename}",
|
|
48
|
+
"{cursor}",
|
|
49
|
+
"{diagnostics}",
|
|
50
|
+
"{cursor_count}",
|
|
51
|
+
"{messages}"
|
|
52
|
+
],
|
|
53
|
+
"right": [
|
|
54
|
+
"{line_ending}",
|
|
55
|
+
"{encoding}",
|
|
56
|
+
"{language}",
|
|
57
|
+
"{lsp}",
|
|
58
|
+
"{warnings}",
|
|
59
|
+
"{update}",
|
|
60
|
+
"{palette}"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
45
63
|
"show_prompt_line": true,
|
|
46
64
|
"show_vertical_scrollbar": true,
|
|
47
65
|
"show_horizontal_scrollbar": false,
|
|
@@ -327,6 +345,29 @@
|
|
|
327
345
|
"default": true,
|
|
328
346
|
"x-section": "Display"
|
|
329
347
|
},
|
|
348
|
+
"status_bar": {
|
|
349
|
+
"description": "Status bar layout and element configuration.\nControls which elements appear in the status bar and how they are arranged.",
|
|
350
|
+
"$ref": "#/$defs/StatusBarConfig",
|
|
351
|
+
"default": {
|
|
352
|
+
"left": [
|
|
353
|
+
"{filename}",
|
|
354
|
+
"{cursor}",
|
|
355
|
+
"{diagnostics}",
|
|
356
|
+
"{cursor_count}",
|
|
357
|
+
"{messages}"
|
|
358
|
+
],
|
|
359
|
+
"right": [
|
|
360
|
+
"{line_ending}",
|
|
361
|
+
"{encoding}",
|
|
362
|
+
"{language}",
|
|
363
|
+
"{lsp}",
|
|
364
|
+
"{warnings}",
|
|
365
|
+
"{update}",
|
|
366
|
+
"{palette}"
|
|
367
|
+
]
|
|
368
|
+
},
|
|
369
|
+
"x-section": "Status Bar"
|
|
370
|
+
},
|
|
330
371
|
"show_prompt_line": {
|
|
331
372
|
"description": "Whether the prompt line is visible by default.\nThe prompt line is the bottom-most line used for command input, search, file open, etc.\nWhen hidden, the prompt line only appears when a prompt is active.\nCan be toggled at runtime via command palette or keybinding.\nDefault: true",
|
|
332
373
|
"type": "boolean",
|
|
@@ -676,6 +717,111 @@
|
|
|
676
717
|
}
|
|
677
718
|
}
|
|
678
719
|
},
|
|
720
|
+
"StatusBarConfig": {
|
|
721
|
+
"description": "Status bar layout and element configuration.\n\nControls which elements appear in the status bar and how they are arranged.\nElements are placed in left and right containers and can be freely reordered.\n\nExample config:\n```json\n{\n \"status_bar\": {\n \"left\": [\"{filename}\", \"{cursor:compact}\"],\n \"right\": [\"{language}\", \"{encoding}\", \"{line_ending}\"]\n }\n}\n```",
|
|
722
|
+
"type": "object",
|
|
723
|
+
"properties": {
|
|
724
|
+
"left": {
|
|
725
|
+
"description": "Elements shown on the left side of the status bar.\nDefault: [\"{filename}\", \"{cursor}\", \"{diagnostics}\", \"{cursor_count}\", \"{messages}\"]",
|
|
726
|
+
"type": "array",
|
|
727
|
+
"items": {
|
|
728
|
+
"$ref": "#/$defs/StatusBarElement"
|
|
729
|
+
},
|
|
730
|
+
"default": [
|
|
731
|
+
"{filename}",
|
|
732
|
+
"{cursor}",
|
|
733
|
+
"{diagnostics}",
|
|
734
|
+
"{cursor_count}",
|
|
735
|
+
"{messages}"
|
|
736
|
+
],
|
|
737
|
+
"x-section": "Status Bar",
|
|
738
|
+
"x-dual-list-sibling": "/editor/status_bar/right"
|
|
739
|
+
},
|
|
740
|
+
"right": {
|
|
741
|
+
"description": "Elements shown on the right side of the status bar.\nDefault: [\"{line_ending}\", \"{encoding}\", \"{language}\", \"{lsp}\", \"{warnings}\", \"{update}\", \"{palette}\"]",
|
|
742
|
+
"type": "array",
|
|
743
|
+
"items": {
|
|
744
|
+
"$ref": "#/$defs/StatusBarElement"
|
|
745
|
+
},
|
|
746
|
+
"default": [
|
|
747
|
+
"{line_ending}",
|
|
748
|
+
"{encoding}",
|
|
749
|
+
"{language}",
|
|
750
|
+
"{lsp}",
|
|
751
|
+
"{warnings}",
|
|
752
|
+
"{update}",
|
|
753
|
+
"{palette}"
|
|
754
|
+
],
|
|
755
|
+
"x-section": "Status Bar",
|
|
756
|
+
"x-dual-list-sibling": "/editor/status_bar/left"
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
},
|
|
760
|
+
"StatusBarElement": {
|
|
761
|
+
"type": "string",
|
|
762
|
+
"x-dual-list-options": [
|
|
763
|
+
{
|
|
764
|
+
"value": "{filename}",
|
|
765
|
+
"name": "Filename"
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"value": "{cursor}",
|
|
769
|
+
"name": "Cursor"
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"value": "{cursor:compact}",
|
|
773
|
+
"name": "Cursor (compact)"
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
"value": "{diagnostics}",
|
|
777
|
+
"name": "Diagnostics"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"value": "{cursor_count}",
|
|
781
|
+
"name": "Cursor Count"
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"value": "{messages}",
|
|
785
|
+
"name": "Messages"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"value": "{chord}",
|
|
789
|
+
"name": "Chord"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"value": "{line_ending}",
|
|
793
|
+
"name": "Line Ending"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"value": "{encoding}",
|
|
797
|
+
"name": "Encoding"
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
"value": "{language}",
|
|
801
|
+
"name": "Language"
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
"value": "{lsp}",
|
|
805
|
+
"name": "LSP"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"value": "{warnings}",
|
|
809
|
+
"name": "Warnings"
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"value": "{update}",
|
|
813
|
+
"name": "Update"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"value": "{palette}",
|
|
817
|
+
"name": "Palette"
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"value": "{clock}",
|
|
821
|
+
"name": "Clock"
|
|
822
|
+
}
|
|
823
|
+
]
|
|
824
|
+
},
|
|
679
825
|
"CursorStyle": {
|
|
680
826
|
"description": "Terminal cursor style",
|
|
681
827
|
"type": "string",
|
package/plugins/git_explorer.ts
CHANGED
|
@@ -10,12 +10,12 @@ const editor = getEditor();
|
|
|
10
10
|
const NAMESPACE = "git-explorer";
|
|
11
11
|
|
|
12
12
|
const COLORS = {
|
|
13
|
-
added:
|
|
14
|
-
modified:
|
|
15
|
-
deleted:
|
|
16
|
-
renamed:
|
|
17
|
-
untracked:
|
|
18
|
-
conflicted:
|
|
13
|
+
added: "ui.file_status_added_fg",
|
|
14
|
+
modified: "ui.file_status_modified_fg",
|
|
15
|
+
deleted: "ui.file_status_deleted_fg",
|
|
16
|
+
renamed: "ui.file_status_renamed_fg",
|
|
17
|
+
untracked: "ui.file_status_untracked_fg",
|
|
18
|
+
conflicted: "ui.file_status_conflicted_fg",
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const PRIORITY = {
|
|
@@ -58,7 +58,7 @@ function parseStatusOutput(output: string, repoRoot: string) {
|
|
|
58
58
|
.split(separator)
|
|
59
59
|
.map((entry) => entry.replace(/\r$/, ""))
|
|
60
60
|
.filter((entry) => entry.length > 0);
|
|
61
|
-
const byPath = new Map<string, { path: string; symbol: string; color:
|
|
61
|
+
const byPath = new Map<string, { path: string; symbol: string; color: string; priority: number }>();
|
|
62
62
|
|
|
63
63
|
for (let i = 0; i < entries.length; i++) {
|
|
64
64
|
const entry = entries[i];
|
package/plugins/lib/fresh.d.ts
CHANGED
|
@@ -399,9 +399,9 @@ type FileExplorerDecoration = {
|
|
|
399
399
|
*/
|
|
400
400
|
symbol: string;
|
|
401
401
|
/**
|
|
402
|
-
* Color as RGB array
|
|
402
|
+
* Color as RGB array or theme key string (e.g., "ui.file_status_added_fg")
|
|
403
403
|
*/
|
|
404
|
-
color:
|
|
404
|
+
color: OverlayColorSpec;
|
|
405
405
|
/**
|
|
406
406
|
* Priority for display when multiple decorations exist (higher wins)
|
|
407
407
|
*/
|
|
@@ -947,6 +947,17 @@ interface EditorAPI {
|
|
|
947
947
|
*/
|
|
948
948
|
scrollToLineCenter(splitId: number, bufferId: number, line: number): boolean;
|
|
949
949
|
/**
|
|
950
|
+
* Scroll any split/panel showing `buffer_id` so `line` is visible.
|
|
951
|
+
* Unlike `scrollToLineCenter`, this does not require a split id — it
|
|
952
|
+
* updates every split's viewport whose active buffer is the given
|
|
953
|
+
* buffer, including inner leaves of a buffer group. Use this from
|
|
954
|
+
* a panel plugin to keep the user's "selected" row in view after
|
|
955
|
+
* arrow-key navigation (the plugin's own selection state isn't
|
|
956
|
+
* automatically reflected in the buffer cursor, so the core-driven
|
|
957
|
+
* viewport would otherwise stay put).
|
|
958
|
+
*/
|
|
959
|
+
scrollBufferToLine(bufferId: number, line: number): boolean;
|
|
960
|
+
/**
|
|
950
961
|
* Find buffer by file path, returns buffer ID or 0 if not found
|
|
951
962
|
*/
|
|
952
963
|
findBufferByPath(path: string): number;
|
|
@@ -1501,6 +1512,18 @@ interface EditorAPI {
|
|
|
1501
1512
|
*/
|
|
1502
1513
|
createVirtualBufferInExistingSplit(opts: CreateVirtualBufferInExistingSplitOptions): Promise<VirtualBufferResult>;
|
|
1503
1514
|
/**
|
|
1515
|
+
* Set the content of a panel within a buffer group
|
|
1516
|
+
*/
|
|
1517
|
+
setPanelContent(groupId: number, panelName: string, entriesArr: Record<string, unknown>[]): boolean;
|
|
1518
|
+
/**
|
|
1519
|
+
* Close a buffer group
|
|
1520
|
+
*/
|
|
1521
|
+
closeBufferGroup(groupId: number): boolean;
|
|
1522
|
+
/**
|
|
1523
|
+
* Focus a specific panel within a buffer group
|
|
1524
|
+
*/
|
|
1525
|
+
focusBufferGroupPanel(groupId: number, panelName: string): boolean;
|
|
1526
|
+
/**
|
|
1504
1527
|
* Set virtual buffer content (takes array of entry objects)
|
|
1505
1528
|
*
|
|
1506
1529
|
* Note: entries should be TextPropertyEntry[] - uses manual parsing for HashMap support
|