hyperlist 1.4.3 → 1.4.4

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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/hyperlist +69 -23
  4. data/hyperlist.gemspec +1 -1
  5. metadata +2 -3
  6. data/test.hl +0 -154
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 735c8dad200fdf5f2ac019def34b0b9f11eed7df0c49f962385bc723b0263cf4
4
- data.tar.gz: db4f459832acaa5d04509d070797aae448062cd507810666a743c1194e61fd32
3
+ metadata.gz: 3dc0016e32134b62af690e6f612eac1820b601cbf86246fb9969441371600a4e
4
+ data.tar.gz: 9be26ded0329bc112f10a79f2fffdb3c28174812665956a79b4ec1b88c854a6f
5
5
  SHA512:
6
- metadata.gz: fb8aa40308aad944488acfcaf2c1319fa65dfed27ce2135d74384b240deb8b2f3fd327def196206f501f134995dd17affae874e6800bb42a440789b9610bc588
7
- data.tar.gz: 88e64082e113bdb8f38ae69f6579fdb4711a62c6699bd7f58ded56a08d32e52367e00062e41b1ecf0d6c80742d2467f833ef05d42fe476f816e1aaa83d8a697b
6
+ metadata.gz: dbe6dbcec4e20da66ff2e7cea0a8f57d7f7001790a3d5313498ae5be5e170509ad777155b09e1b969dc47fdb630923ebebbc1cb17016608615cd3378d3158652
7
+ data.tar.gz: 57bf4c6764337eba7502ccaceb7a158d8ce8dd09c7840cf9c05047e2787910f0d28e446f913456fd7ee8893ec9be5fadb7b1b8f5766aebfd181a4cd7154fc8a6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to the HyperList Ruby TUI will be documented in this file.
4
4
 
5
+ ## [1.4.4] - 2025-09-01
6
+
7
+ ### Added
8
+ - **Case conversion commands**
9
+ - `gU` to convert current line to UPPERCASE
10
+ - `gu` to convert current line to lowercase
11
+ - Works with all HyperList elements (checkboxes, operators, etc.)
12
+
13
+ ### Fixed
14
+ - **Color code display issues**
15
+ - Fixed bracket content extraction in safe_regex_replace to preserve qualifier text
16
+ - Updated operator regex pattern to match after ANSI placeholders
17
+ - Both numbered lists (1.) and operators (NOT:) now color correctly when combined
18
+
19
+ ## [1.4.3] - 2025-08-30
20
+
21
+ ### Fixed
22
+ - **Multi-line item handling**
23
+ - Proper handling of multi-line items per HyperList specification
24
+ - Fixed display and editing of items with embedded newlines
25
+
5
26
  ## [1.4.2] - 2025-08-29
6
27
 
7
28
  ### Fixed
data/hyperlist CHANGED
@@ -72,7 +72,7 @@ class HyperListApp
72
72
  include Rcurses::Input
73
73
  include Rcurses::Cursor
74
74
 
75
- VERSION = "1.4.3"
75
+ VERSION = "1.4.4"
76
76
 
77
77
  def initialize(filename = nil)
78
78
  @filename = filename ? File.expand_path(filename) : nil
@@ -1337,7 +1337,10 @@ class HyperListApp
1337
1337
  elsif !processed_checkbox
1338
1338
  # Only handle other qualifiers if we didn't process a checkbox
1339
1339
  # Based on hyperlist.vim: '\[.\{-}\]'
1340
- result.gsub!(/\[([^\]]*)\]/) { "[#{$1}]".fg(colors["green"]) } # Green for all qualifiers
1340
+ result = safe_regex_replace(result, /\[([^\]]*)\]/) do |match|
1341
+ content = match[1..-2] # Extract content between brackets
1342
+ "[#{content}]".fg(colors["green"]) # Green for all qualifiers
1343
+ end
1341
1344
  end
1342
1345
 
1343
1346
  # We'll handle parentheses AFTER operators/properties to avoid conflicts
@@ -1351,21 +1354,27 @@ class HyperListApp
1351
1354
  # Handle operators and properties with colon pattern
1352
1355
  # Operators: ALL-CAPS followed by colon (with or without space)
1353
1356
  # Properties: Mixed case followed by colon and space
1354
- result.gsub!(/(\A|\s+)([a-zA-Z][a-zA-Z0-9_\-() .\/=]*):(\s*)/) do
1355
- prefix_space = $1
1356
- text_part = $2
1357
- space_after = $3 || ""
1358
- colon_space = ":#{space_after}"
1359
-
1360
- # Check if it's an operator (ALL-CAPS with optional _, -, (), /, =, spaces)
1361
- if text_part =~ /^[A-Z][A-Z_\-() \/=]*$/
1362
- prefix_space + text_part.fg(colors["blue"]) + colon_space.fg(colors["blue"]) # Blue for operators (including S: and T:)
1363
- elsif text_part.length >= 2 && space_after.include?(" ")
1364
- # It's a property (mixed case, at least 2 chars, has space after colon)
1365
- prefix_space + text_part.fg(colors["red"]) + colon_space.fg(colors["red"]) # Red for properties
1357
+ # Modified pattern to also match after ANSI placeholders (⟨ANSI\d+⟩)
1358
+ result = safe_regex_replace(result, /(\A|\s+|⟨ANSI\d+⟩)([a-zA-Z][a-zA-Z0-9_\-() .\/=]*):(\s*)/) do |match|
1359
+ # Extract parts from the match
1360
+ if match =~ /(\A|\s+|⟨ANSI\d+⟩)([a-zA-Z][a-zA-Z0-9_\-() .\/=]*):(\s*)/
1361
+ prefix_space = $1
1362
+ text_part = $2
1363
+ space_after = $3 || ""
1364
+ colon_space = ":#{space_after}"
1365
+
1366
+ # Check if it's an operator (ALL-CAPS with optional _, -, (), /, =, spaces)
1367
+ if text_part =~ /^[A-Z][A-Z_\-() \/=]*$/
1368
+ prefix_space + text_part.fg(colors["blue"]) + colon_space.fg(colors["blue"]) # Blue for operators (including S: and T:)
1369
+ elsif text_part.length >= 2 && space_after.include?(" ")
1370
+ # It's a property (mixed case, at least 2 chars, has space after colon)
1371
+ prefix_space + text_part.fg(colors["red"]) + colon_space.fg(colors["red"]) # Red for properties
1372
+ else
1373
+ # Leave as is
1374
+ match
1375
+ end
1366
1376
  else
1367
- # Leave as is
1368
- prefix_space + text_part + colon_space
1377
+ match
1369
1378
  end
1370
1379
  end
1371
1380
 
@@ -2334,6 +2343,34 @@ class HyperListApp
2334
2343
  clear_cache # Clear cache when content changes
2335
2344
  end
2336
2345
 
2346
+ def uppercase_line
2347
+ visible = get_visible_items
2348
+ return if @current >= visible.length
2349
+
2350
+ item = visible[@current]
2351
+ real_idx = get_real_index(item)
2352
+
2353
+ save_undo_state # Save state before modification
2354
+ @items[real_idx]["text"] = item["text"].upcase
2355
+ @modified = true
2356
+ clear_cache # Clear cache when content changes
2357
+ @message = "Line converted to uppercase"
2358
+ end
2359
+
2360
+ def lowercase_line
2361
+ visible = get_visible_items
2362
+ return if @current >= visible.length
2363
+
2364
+ item = visible[@current]
2365
+ real_idx = get_real_index(item)
2366
+
2367
+ save_undo_state # Save state before modification
2368
+ @items[real_idx]["text"] = item["text"].downcase
2369
+ @modified = true
2370
+ clear_cache # Clear cache when content changes
2371
+ @message = "Line converted to lowercase"
2372
+ end
2373
+
2337
2374
  def delete_line(with_children = false)
2338
2375
  visible = get_visible_items
2339
2376
  return if visible.empty?
@@ -2883,6 +2920,7 @@ class HyperListApp
2883
2920
  help_lines << help_line("#{"i/Enter".fg("10")}", "Edit line", "#{"o".fg("10")}", "Insert line below")
2884
2921
  help_lines << help_line("#{"O".fg("10")}", "Insert line above", "#{"a".fg("10")}", "Insert child")
2885
2922
  help_lines << help_line("#{"A".fg("10")}", "Insert outdented", "#{"W".fg("10")}", "Save and quit")
2923
+ help_lines << help_line("#{"gU".fg("10")}", "Uppercase line", "#{"gu".fg("10")}", "Lowercase line")
2886
2924
  help_lines << help_line("#{"I".fg("10")}", "Cycle indent (2-5)")
2887
2925
  help_lines << help_line("#{"D".fg("10")}", "Delete+yank line", "#{"C-D".fg("10")}", "Delete+yank item&descendants")
2888
2926
  help_lines << help_line("#{"y".fg("10")}" + "/".fg("10") + "#{"Y".fg("10")}", "Copy line/tree", "#{"p".fg("10")}", "Paste")
@@ -5613,13 +5651,21 @@ class HyperListApp
5613
5651
  @current = [visible.length - 1, 0].max
5614
5652
  update_presentation_focus if @presentation_mode
5615
5653
  end
5616
- when "g" # Go to top (was gg)
5617
- if @split_view && @active_pane == :split
5618
- @split_current = 0
5619
- else
5620
- @current = 0
5621
- @offset = 0
5622
- update_presentation_focus if @presentation_mode
5654
+ when "g" # Go to top (gg) or text case commands (gU/gu)
5655
+ next_c = getchr
5656
+ case next_c
5657
+ when "g" # gg - go to top
5658
+ if @split_view && @active_pane == :split
5659
+ @split_current = 0
5660
+ else
5661
+ @current = 0
5662
+ @offset = 0
5663
+ update_presentation_focus if @presentation_mode
5664
+ end
5665
+ when "U" # gU - uppercase line
5666
+ uppercase_line
5667
+ when "u" # gu - lowercase line
5668
+ lowercase_line
5623
5669
  end
5624
5670
  when "G" # Go to bottom
5625
5671
  if @split_view && @active_pane == :split
data/hyperlist.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "hyperlist"
3
- spec.version = "1.4.3"
3
+ spec.version = "1.4.4"
4
4
  spec.authors = ["Geir Isene"]
5
5
  spec.email = ["g@isene.com"]
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: "."
10
10
  cert_chain: []
11
- date: 2025-08-30 00:00:00.000000000 Z
11
+ date: 2025-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rcurses
@@ -79,7 +79,6 @@ files:
79
79
  - img/screenshot_help.png
80
80
  - img/screenshot_sample.png
81
81
  - sample.hl
82
- - test.hl
83
82
  homepage: https://github.com/isene/HyperList
84
83
  licenses:
85
84
  - Unlicense
data/test.hl DELETED
@@ -1,154 +0,0 @@
1
- HyperList Ruby TUI Test Suite v1.0
2
- About This Test Suite
3
- Purpose: Test all features of the HyperList Ruby TUI application
4
- Run with: ./hyperlist test.hl
5
- Navigate through and test each feature systematically
6
- SYNTAX HIGHLIGHTING & COLORS
7
- Check: Property in red; Dates like 2025-08-12 should be red
8
- AND: OR: IF: THEN: Operators should appear in blue
9
- [?] Conditional checkboxes should be green
10
- #hashtags should appear in yellow/orange
11
- <references> should appear in magenta
12
- (parentheses content) should be in cyan
13
- "quoted strings" should be in bright cyan
14
- *bold text* should appear bold
15
- /italic text/ should appear italic
16
- _underlined text_ should appear underlined
17
- Templates with = markers for filling
18
- NAVIGATION TESTS
19
- Basic Movement
20
- j/↓ Move down through items
21
- k/↑ Move up through items
22
- h Go to parent item (move cursor here and press h)
23
- l Go to first child (press l from parent)
24
- g/Home Go to top of document
25
- G/End Go to bottom of document
26
- PgUp/PgDn Page up and down
27
- Search
28
- Slash key: Search for text (try searching for "test")
29
- n Jump to next search match
30
- Marks and Jumps
31
- ma Set mark 'a' at current position
32
- 'a Jump back to mark 'a'
33
- '' Jump to previous position
34
- R Jump to reference (place cursor on <NAVIGATION TESTS> and press R)
35
- Template Navigation
36
- First template =
37
- Second template =
38
- Third template =
39
- Press N to jump to next template marker and edit
40
- FOLDING TESTS
41
- Space Toggle fold on this item
42
- This child should hide/show when parent is folded
43
- And this grandchild too
44
- Even deeper nesting works
45
- za Toggle all folds recursively
46
- zo Open fold / zc Close fold
47
- zR Open all folds / zM Close all folds
48
- 1-9 Expand to specific level (try pressing 2)
49
- Level 2 item
50
- Level 3 item
51
- Level 4 item
52
- Level 5 item
53
- 0 Multi-digit fold level (press 0 then 1 then 2 for level 12)
54
- EDITING TESTS
55
- Basic Editing
56
- i/Enter Edit current line
57
- o Insert new line below
58
- O Insert new line above
59
- a Insert child item
60
- Delete Operations
61
- D Delete and yank current line only
62
- C-D Delete and yank item with all descendants
63
- Copy/Paste
64
- y Copy current line only
65
- Y Copy item with descendants
66
- p Paste yanked content
67
- Undo/Redo
68
- u Undo last change
69
- r/C-R Redo undone change
70
- . Repeat last action
71
- Moving Items
72
- S-UP/S-DOWN Move single item up/down
73
- C-UP/C-DOWN Move item with descendants up/down
74
- Indentation
75
- Tab Indent item and children
76
- S-Tab Unindent item and children
77
- → Indent item only
78
- ← Unindent item only
79
- CHECKBOX TESTS
80
- [ ] Press v to add/toggle checkbox
81
- [X] Completed checkbox (green)
82
- [O] In progress checkbox (bright green bold)
83
- [-] Partial checkbox (dim green)
84
- [?] Conditional checkbox (green)
85
- [3] Numbered checkbox
86
- [2025-08-12 14:30] Date checkbox
87
- Press V to toggle with timestamp
88
- SPECIAL FEATURES
89
- Presentation Mode
90
- Press P to enter presentation mode
91
- Current item and ancestors shown, rest hidden
92
- Press P again to exit
93
- Underline Toggle
94
- \u Toggle underlining of state/transition items
95
- S: State items (descriptive)
96
- T: Transition items (actions)
97
- File Operations
98
- F Open file reference (place cursor on file path)
99
- <sample.hl> Try opening this reference with F
100
- FILE COMMANDS
101
- :w Save file
102
- :q Quit (asks to save if modified)
103
- :wq Save and quit
104
- Q Force quit without saving
105
- :e filename Open another file
106
- :recent Show recent files
107
- :export md Export to Markdown
108
- :export html Export to HTML
109
- :export txt Export to plain text
110
- :graph Generate PNG graph visualization
111
- :vsplit Split view vertically
112
- ww Switch between split panes
113
- :as on Enable autosave
114
- :as off Disable autosave
115
- :as 30 Set autosave interval to 30 seconds
116
- ADVANCED TESTS
117
- Complex Nesting
118
- Parent 1
119
- Child 1.1
120
- Grandchild 1.1.1
121
- Great-grandchild 1.1.1.1
122
- Great-great-grandchild 1.1.1.1.1
123
- Child 1.2
124
- Grandchild 1.2.1
125
- Grandchild 1.2.2
126
- Parent 2
127
- Child 2.1
128
- Child 2.2
129
- Mixed Formatting
130
- Item with *bold* and /italic/ and _underline_
131
- Item with #multiple #hash #tags
132
- Item with <reference> and (parentheses) and "quotes"
133
- AND: Operator with [X] checkbox and 2025-08-12: date
134
- Long Lines
135
- This is a very long line that should wrap properly in the terminal display and maintain proper indentation when it continues on the next visual line without breaking the hierarchical structure of the HyperList
136
- Special Characters
137
- Item with special chars: @#$%^&*(){}[]|\\:;"'<>,.?/
138
- Unicode: ★ ☆ ♠ ♣ ♥ ♦ → ← ↑ ↓
139
- Emojis: 😀 🎉 ✓ ✗ ⚠️ 📝
140
- HELP SYSTEM
141
- ? Show help screen with key bindings
142
- ?? Show full documentation
143
- Use UP/DOWN to scroll through help
144
- Press any other key to exit help
145
- TEST COMPLETION
146
- [ ] All syntax highlighting verified
147
- [ ] All navigation features tested
148
- [ ] All folding operations work
149
- [ ] All editing functions tested
150
- [ ] Checkboxes functioning correctly
151
- [ ] Special features operational
152
- [ ] File commands working
153
- [ ] Help system accessible
154
- If all tests pass, the Ruby HyperList TUI is working correctly!