@fresh-editor/fresh-editor 0.2.13 → 0.2.16

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.
@@ -476,7 +476,6 @@ const SHORTCUTS = {
476
476
 
477
477
  editor.defineMode(
478
478
  "theme-editor",
479
- "normal",
480
479
  [
481
480
  // Navigation
482
481
  ["Return", "theme_editor_enter"],
@@ -485,6 +484,8 @@ editor.defineMode(
485
484
  ["S-Tab", "theme_editor_focus_shift_tab"],
486
485
  ["Up", "theme_editor_nav_up"],
487
486
  ["Down", "theme_editor_nav_down"],
487
+ ["PageUp", "theme_editor_page_up"],
488
+ ["PageDown", "theme_editor_page_down"],
488
489
  ["Left", "theme_editor_nav_left"],
489
490
  ["Right", "theme_editor_nav_right"],
490
491
  ["Escape", "theme_editor_escape"],
@@ -2116,6 +2117,34 @@ function theme_editor_nav_up() : void {
2116
2117
  }
2117
2118
  registerHandler("theme_editor_nav_up", theme_editor_nav_up);
2118
2119
 
2120
+ /**
2121
+ * Page Down - jump a page of items in the tree
2122
+ */
2123
+ function theme_editor_page_down() : void {
2124
+ if (state.bufferId === null) return;
2125
+
2126
+ if (state.focusPanel === "tree") {
2127
+ const pageSize = Math.max(1, Math.max(8, state.viewportHeight - 2) - 1);
2128
+ state.selectedIndex = Math.min(state.visibleFields.length - 1, state.selectedIndex + pageSize);
2129
+ updateDisplay();
2130
+ }
2131
+ }
2132
+ registerHandler("theme_editor_page_down", theme_editor_page_down);
2133
+
2134
+ /**
2135
+ * Page Up - jump a page of items in the tree
2136
+ */
2137
+ function theme_editor_page_up() : void {
2138
+ if (state.bufferId === null) return;
2139
+
2140
+ if (state.focusPanel === "tree") {
2141
+ const pageSize = Math.max(1, Math.max(8, state.viewportHeight - 2) - 1);
2142
+ state.selectedIndex = Math.max(0, state.selectedIndex - pageSize);
2143
+ updateDisplay();
2144
+ }
2145
+ }
2146
+ registerHandler("theme_editor_page_up", theme_editor_page_up);
2147
+
2119
2148
  /**
2120
2149
  * Navigate left/right - for picker grid navigation
2121
2150
  */
@@ -1592,7 +1592,7 @@ registerHandler("vi_cancel", vi_cancel);
1592
1592
  // ============================================================================
1593
1593
 
1594
1594
  // Define vi-normal mode
1595
- editor.defineMode("vi-normal", null, [
1595
+ editor.defineMode("vi-normal", [
1596
1596
  // Count prefix (digits 1-9 start count, 0 is special)
1597
1597
  ["1", "vi_digit_1"],
1598
1598
  ["2", "vi_digit_2"],
@@ -1690,7 +1690,7 @@ editor.defineMode("vi-normal", null, [
1690
1690
  ], true); // read_only = true to prevent character insertion
1691
1691
 
1692
1692
  // Define vi-insert mode - only Escape is special, other keys insert text
1693
- editor.defineMode("vi-insert", null, [
1693
+ editor.defineMode("vi-insert", [
1694
1694
  ["Escape", "vi_escape"],
1695
1695
  // Pass through to standard editor shortcuts
1696
1696
  ["C-p", "command_palette"],
@@ -1830,7 +1830,7 @@ async function vi_fc_space(): Promise<void> { return vi_find_char_handler(" ");
1830
1830
  registerHandler("vi_fc_space", vi_fc_space);
1831
1831
 
1832
1832
  // Define vi-find-char mode with all the character bindings
1833
- editor.defineMode("vi-find-char", null, [
1833
+ editor.defineMode("vi-find-char", [
1834
1834
  ["Escape", "vi_find_char_cancel"],
1835
1835
  // Letters
1836
1836
  ["a", "vi_fc_a"], ["b", "vi_fc_b"], ["c", "vi_fc_c"], ["d", "vi_fc_d"],
@@ -1856,7 +1856,7 @@ editor.defineMode("vi-find-char", null, [
1856
1856
  ], true);
1857
1857
 
1858
1858
  // Define vi-operator-pending mode
1859
- editor.defineMode("vi-operator-pending", null, [
1859
+ editor.defineMode("vi-operator-pending", [
1860
1860
  // Count prefix in operator-pending mode (for d3w = delete 3 words)
1861
1861
  ["1", "vi_digit_1"],
1862
1862
  ["2", "vi_digit_2"],
@@ -1895,7 +1895,7 @@ editor.defineMode("vi-operator-pending", null, [
1895
1895
  ], true);
1896
1896
 
1897
1897
  // Define vi-text-object mode (waiting for object type: w, ", (, etc.)
1898
- editor.defineMode("vi-text-object", null, [
1898
+ editor.defineMode("vi-text-object", [
1899
1899
  // Word objects
1900
1900
  ["w", "vi_to_word"],
1901
1901
  ["W", "vi_to_WORD"],
@@ -1922,7 +1922,7 @@ editor.defineMode("vi-text-object", null, [
1922
1922
  ], true);
1923
1923
 
1924
1924
  // Define vi-visual mode (character-wise)
1925
- editor.defineMode("vi-visual", null, [
1925
+ editor.defineMode("vi-visual", [
1926
1926
  // Count prefix
1927
1927
  ["1", "vi_digit_1"],
1928
1928
  ["2", "vi_digit_2"],
@@ -1968,7 +1968,7 @@ editor.defineMode("vi-visual", null, [
1968
1968
  ], true);
1969
1969
 
1970
1970
  // Define vi-visual-line mode (line-wise)
1971
- editor.defineMode("vi-visual-line", null, [
1971
+ editor.defineMode("vi-visual-line", [
1972
1972
  // Count prefix
1973
1973
  ["1", "vi_digit_1"],
1974
1974
  ["2", "vi_digit_2"],
@@ -2006,7 +2006,7 @@ editor.defineMode("vi-visual-line", null, [
2006
2006
  ], true);
2007
2007
 
2008
2008
  // Define vi-visual-block mode (column/block selection)
2009
- editor.defineMode("vi-visual-block", null, [
2009
+ editor.defineMode("vi-visual-block", [
2010
2010
  // Count prefix
2011
2011
  ["1", "vi_digit_1"],
2012
2012
  ["2", "vi_digit_2"],