hyperlist 1.1.3 → 1.1.5
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.
- checksums.yaml +4 -4
- data/debug_instructions.md +112 -0
- data/diagnose.rb +115 -0
- data/diagnose_safe.rb +198 -0
- data/fix_terminal.sh +33 -0
- data/hyperlist +33 -24
- data/hyperlist.gemspec +2 -2
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35f413c3d4847c79d6284a15ebb366df9bf40371f6b9df3a5be2c34b6cb7a17b
|
4
|
+
data.tar.gz: 7c528e553d89eacdbd1b0ee1e87d847f9394cf43cd8a690dcd2dd241cb679624
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc7607ecec08008dcc69d9a070a71d1b68edb564b8a9ecacd2cc4c67012188b350c5ff09b3f1a8015c9798a000c5eaffa09b4a637ac33bbfe7a96d943f0b1c40
|
7
|
+
data.tar.gz: 42ddb51750d0cecc9cf6afc8797bb3b89eb283ebcee2b085ab1ec2f401aefb73ed8f5f777d9c9cabfd6f6dda85619da317ae0b6db0fa0801868aad53ad26c589
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# Debugging HyperList Issues
|
2
|
+
|
3
|
+
## For the user experiencing startup crashes:
|
4
|
+
|
5
|
+
### 1. First, verify you have the latest versions:
|
6
|
+
|
7
|
+
```bash
|
8
|
+
gem list hyperlist
|
9
|
+
# Should show: hyperlist (1.1.3)
|
10
|
+
|
11
|
+
gem list rcurses
|
12
|
+
# Should show: rcurses (5.1.4) or higher
|
13
|
+
```
|
14
|
+
|
15
|
+
### 2. If not, update to the latest:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
gem update hyperlist
|
19
|
+
gem update rcurses
|
20
|
+
```
|
21
|
+
|
22
|
+
### 3. Run with debug mode to see errors:
|
23
|
+
|
24
|
+
```bash
|
25
|
+
# Set debug environment variable
|
26
|
+
export RCURSES_DEBUG=1
|
27
|
+
export DEBUG=1
|
28
|
+
|
29
|
+
# Then run hyperlist
|
30
|
+
hyperlist
|
31
|
+
|
32
|
+
# Or run in one line:
|
33
|
+
DEBUG=1 RCURSES_DEBUG=1 hyperlist
|
34
|
+
```
|
35
|
+
|
36
|
+
### 4. Alternative: Run with Ruby directly to see errors:
|
37
|
+
|
38
|
+
```bash
|
39
|
+
# Find where hyperlist is installed
|
40
|
+
which hyperlist
|
41
|
+
|
42
|
+
# Run it directly with Ruby to see any errors
|
43
|
+
ruby $(which hyperlist)
|
44
|
+
```
|
45
|
+
|
46
|
+
### 5. Check Ruby version compatibility:
|
47
|
+
|
48
|
+
```bash
|
49
|
+
ruby --version
|
50
|
+
# HyperList requires Ruby 3.0.0 or higher
|
51
|
+
```
|
52
|
+
|
53
|
+
### 6. Try running with verbose Ruby output:
|
54
|
+
|
55
|
+
```bash
|
56
|
+
ruby -w $(which hyperlist)
|
57
|
+
```
|
58
|
+
|
59
|
+
### 7. Check for missing dependencies:
|
60
|
+
|
61
|
+
```bash
|
62
|
+
# This will show if rcurses is properly installed
|
63
|
+
ruby -e "require 'rcurses'; puts 'rcurses loaded successfully'"
|
64
|
+
```
|
65
|
+
|
66
|
+
### 8. Create a simple test file to isolate the issue:
|
67
|
+
|
68
|
+
Create a file called `test_hyperlist.rb`:
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
#!/usr/bin/env ruby
|
72
|
+
|
73
|
+
puts "Ruby version: #{RUBY_VERSION}"
|
74
|
+
puts "Testing rcurses..."
|
75
|
+
|
76
|
+
begin
|
77
|
+
require 'rcurses'
|
78
|
+
puts "✓ rcurses loaded successfully (version from gem)"
|
79
|
+
rescue LoadError => e
|
80
|
+
puts "✗ Failed to load rcurses: #{e.message}"
|
81
|
+
exit 1
|
82
|
+
end
|
83
|
+
|
84
|
+
puts "\nTesting basic rcurses functionality..."
|
85
|
+
begin
|
86
|
+
include Rcurses
|
87
|
+
puts "✓ Rcurses module included"
|
88
|
+
puts "✓ All basic checks passed!"
|
89
|
+
rescue => e
|
90
|
+
puts "✗ Error: #{e.message}"
|
91
|
+
exit 1
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
95
|
+
Run it with:
|
96
|
+
```bash
|
97
|
+
ruby test_hyperlist.rb
|
98
|
+
```
|
99
|
+
|
100
|
+
### 9. If all else fails, capture output:
|
101
|
+
|
102
|
+
```bash
|
103
|
+
# Run with script to capture all output
|
104
|
+
script -c "hyperlist" hyperlist_output.txt
|
105
|
+
|
106
|
+
# Then send us the hyperlist_output.txt file
|
107
|
+
```
|
108
|
+
|
109
|
+
## Notes:
|
110
|
+
- GDB won't work with Ruby scripts (it's for compiled binaries)
|
111
|
+
- The new error handling in rcurses 5.1.4+ should show errors after terminal cleanup
|
112
|
+
- Setting DEBUG=1 or RCURSES_DEBUG=1 will show full stack traces
|
data/diagnose.rb
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# HyperList Diagnostic Script
|
3
|
+
# Run this to help diagnose installation/startup issues
|
4
|
+
|
5
|
+
puts "=" * 60
|
6
|
+
puts "HyperList Diagnostic Report"
|
7
|
+
puts "=" * 60
|
8
|
+
|
9
|
+
# Check Ruby version
|
10
|
+
puts "\n1. Ruby Version:"
|
11
|
+
puts " #{RUBY_VERSION} (#{RUBY_PLATFORM})"
|
12
|
+
if RUBY_VERSION < "3.0.0"
|
13
|
+
puts " ⚠️ WARNING: HyperList requires Ruby 3.0.0 or higher"
|
14
|
+
else
|
15
|
+
puts " ✓ Ruby version OK"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Check gem versions
|
19
|
+
puts "\n2. Gem Versions:"
|
20
|
+
begin
|
21
|
+
hyperlist_version = `gem list hyperlist --local`.match(/hyperlist \(([\d.]+)\)/)[1] rescue "not found"
|
22
|
+
rcurses_version = `gem list rcurses --local`.match(/rcurses \(([\d.]+(?:,\s*[\d.]+)*)\)/)[1] rescue "not found"
|
23
|
+
|
24
|
+
puts " hyperlist: #{hyperlist_version}"
|
25
|
+
if hyperlist_version >= "1.1.3"
|
26
|
+
puts " ✓ HyperList version OK"
|
27
|
+
else
|
28
|
+
puts " ⚠️ Please update: gem update hyperlist"
|
29
|
+
end
|
30
|
+
|
31
|
+
puts " rcurses: #{rcurses_version}"
|
32
|
+
if rcurses_version.include?("5.1.4") || rcurses_version >= "5.1.4"
|
33
|
+
puts " ✓ rcurses version OK"
|
34
|
+
else
|
35
|
+
puts " ⚠️ Please update: gem update rcurses"
|
36
|
+
end
|
37
|
+
rescue => e
|
38
|
+
puts " Error checking gems: #{e.message}"
|
39
|
+
end
|
40
|
+
|
41
|
+
# Test loading rcurses
|
42
|
+
puts "\n3. Testing rcurses load:"
|
43
|
+
begin
|
44
|
+
require 'rcurses'
|
45
|
+
puts " ✓ rcurses loaded successfully"
|
46
|
+
|
47
|
+
# Check if we can access rcurses modules
|
48
|
+
include Rcurses
|
49
|
+
puts " ✓ Rcurses modules accessible"
|
50
|
+
rescue LoadError => e
|
51
|
+
puts " ✗ Failed to load rcurses: #{e.message}"
|
52
|
+
puts " Try: gem install rcurses"
|
53
|
+
rescue => e
|
54
|
+
puts " ✗ Error with rcurses: #{e.message}"
|
55
|
+
end
|
56
|
+
|
57
|
+
# Test terminal capabilities
|
58
|
+
puts "\n4. Terminal Check:"
|
59
|
+
puts " TERM: #{ENV['TERM'] || 'not set'}"
|
60
|
+
puts " TTY: #{$stdin.tty? ? 'Yes' : 'No'}"
|
61
|
+
puts " Encoding: #{Encoding.default_external}"
|
62
|
+
|
63
|
+
# Check for HyperList executable
|
64
|
+
puts "\n5. HyperList Installation:"
|
65
|
+
hyperlist_path = `which hyperlist`.strip
|
66
|
+
if hyperlist_path.empty?
|
67
|
+
puts " ✗ hyperlist command not found in PATH"
|
68
|
+
puts " Try: gem install hyperlist"
|
69
|
+
else
|
70
|
+
puts " ✓ Found at: #{hyperlist_path}"
|
71
|
+
|
72
|
+
# Check if it's executable
|
73
|
+
if File.executable?(hyperlist_path)
|
74
|
+
puts " ✓ File is executable"
|
75
|
+
else
|
76
|
+
puts " ⚠️ File is not executable"
|
77
|
+
puts " Try: chmod +x #{hyperlist_path}"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Try to load core dependencies
|
82
|
+
puts "\n6. Core Dependencies:"
|
83
|
+
deps = ['io/console', 'date', 'cgi', 'openssl', 'digest', 'base64']
|
84
|
+
deps.each do |dep|
|
85
|
+
begin
|
86
|
+
require dep
|
87
|
+
puts " ✓ #{dep}"
|
88
|
+
rescue LoadError => e
|
89
|
+
puts " ✗ #{dep}: #{e.message}"
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Test creating a basic rcurses pane (without initializing terminal)
|
94
|
+
puts "\n7. Testing Rcurses Pane Creation (simulation):"
|
95
|
+
begin
|
96
|
+
# Don't actually initialize the terminal, just test the class exists
|
97
|
+
if defined?(Rcurses::Pane)
|
98
|
+
puts " ✓ Rcurses::Pane class exists"
|
99
|
+
else
|
100
|
+
puts " ✗ Rcurses::Pane class not found"
|
101
|
+
end
|
102
|
+
rescue => e
|
103
|
+
puts " ✗ Error: #{e.message}"
|
104
|
+
end
|
105
|
+
|
106
|
+
puts "\n" + "=" * 60
|
107
|
+
puts "Diagnostic complete!"
|
108
|
+
puts "=" * 60
|
109
|
+
|
110
|
+
puts "\nIf everything shows ✓ but hyperlist still crashes:"
|
111
|
+
puts "1. Run with debug mode: DEBUG=1 RCURSES_DEBUG=1 hyperlist"
|
112
|
+
puts "2. Check for error log: cat ~/.hyperlist_error.log"
|
113
|
+
puts "3. Try running directly: ruby #{hyperlist_path}"
|
114
|
+
|
115
|
+
puts "\nPlease share this diagnostic output when reporting issues."
|
data/diagnose_safe.rb
ADDED
@@ -0,0 +1,198 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# HyperList Safe Diagnostic Script
|
3
|
+
# This version ensures terminal remains in a sane state
|
4
|
+
|
5
|
+
# First, ensure terminal is in sane state
|
6
|
+
system("stty sane 2>/dev/null")
|
7
|
+
|
8
|
+
# Ensure we're not in raw mode and output is flushed properly
|
9
|
+
$stdout.sync = true
|
10
|
+
$stderr.sync = true
|
11
|
+
|
12
|
+
# Don't load rcurses until we explicitly test it
|
13
|
+
puts "=" * 60
|
14
|
+
puts "HyperList Safe Diagnostic Report"
|
15
|
+
puts "=" * 60
|
16
|
+
|
17
|
+
# Check Ruby version
|
18
|
+
puts "\n1. Ruby Version:"
|
19
|
+
puts " #{RUBY_VERSION} (#{RUBY_PLATFORM})"
|
20
|
+
if RUBY_VERSION < "3.0.0"
|
21
|
+
puts " WARNING: HyperList requires Ruby 3.0.0 or higher"
|
22
|
+
elsif RUBY_VERSION >= "3.4.0"
|
23
|
+
puts " WARNING: Ruby 3.4+ is a development version and may have compatibility issues"
|
24
|
+
puts " RECOMMENDED: Use Ruby 3.3.x for stability"
|
25
|
+
else
|
26
|
+
puts " OK: Ruby version supported"
|
27
|
+
end
|
28
|
+
|
29
|
+
# Check gem versions WITHOUT loading them
|
30
|
+
puts "\n2. Installed Gem Versions:"
|
31
|
+
begin
|
32
|
+
hyperlist_output = `gem list hyperlist --local 2>&1`
|
33
|
+
rcurses_output = `gem list rcurses --local 2>&1`
|
34
|
+
|
35
|
+
if hyperlist_output.include?("hyperlist")
|
36
|
+
version = hyperlist_output.match(/hyperlist \(([\d.]+)/)[1] rescue "unknown"
|
37
|
+
puts " hyperlist: #{version}"
|
38
|
+
if version >= "1.1.3"
|
39
|
+
puts " OK: HyperList version is current"
|
40
|
+
else
|
41
|
+
puts " UPDATE NEEDED: gem update hyperlist"
|
42
|
+
end
|
43
|
+
else
|
44
|
+
puts " hyperlist: NOT INSTALLED"
|
45
|
+
puts " Run: gem install hyperlist"
|
46
|
+
end
|
47
|
+
|
48
|
+
if rcurses_output.include?("rcurses")
|
49
|
+
# Extract just the first/latest version
|
50
|
+
version = rcurses_output.match(/rcurses \(([\d.]+)/)[1] rescue "unknown"
|
51
|
+
puts " rcurses: #{version}"
|
52
|
+
if version >= "5.1.4"
|
53
|
+
puts " OK: rcurses version is current"
|
54
|
+
else
|
55
|
+
puts " UPDATE NEEDED: gem update rcurses"
|
56
|
+
end
|
57
|
+
else
|
58
|
+
puts " rcurses: NOT INSTALLED"
|
59
|
+
puts " Run: gem install rcurses"
|
60
|
+
end
|
61
|
+
rescue => e
|
62
|
+
puts " Error checking gems: #{e.message}"
|
63
|
+
end
|
64
|
+
|
65
|
+
# Check terminal environment
|
66
|
+
puts "\n3. Terminal Environment:"
|
67
|
+
puts " TERM: #{ENV['TERM'] || 'not set'}"
|
68
|
+
puts " LANG: #{ENV['LANG'] || 'not set'}"
|
69
|
+
puts " TTY: #{$stdin.tty? ? 'Yes' : 'No'}"
|
70
|
+
puts " Terminal columns: #{`tput cols`.strip rescue 'unknown'}"
|
71
|
+
puts " Terminal rows: #{`tput lines`.strip rescue 'unknown'}"
|
72
|
+
|
73
|
+
# Check for HyperList executable
|
74
|
+
puts "\n4. HyperList Executable:"
|
75
|
+
hyperlist_path = `which hyperlist 2>/dev/null`.strip
|
76
|
+
if hyperlist_path.empty?
|
77
|
+
puts " NOT FOUND in PATH"
|
78
|
+
|
79
|
+
# Check common gem bin paths
|
80
|
+
gem_paths = [
|
81
|
+
"#{ENV['HOME']}/.local/share/gem/ruby/*/bin/hyperlist",
|
82
|
+
"#{ENV['HOME']}/.gem/ruby/*/bin/hyperlist",
|
83
|
+
"/usr/local/bin/hyperlist",
|
84
|
+
"/usr/bin/hyperlist"
|
85
|
+
]
|
86
|
+
|
87
|
+
found = false
|
88
|
+
gem_paths.each do |pattern|
|
89
|
+
Dir.glob(pattern).each do |path|
|
90
|
+
if File.exist?(path)
|
91
|
+
puts " Found at: #{path}"
|
92
|
+
puts " Add to PATH: export PATH=\"#{File.dirname(path)}:$PATH\""
|
93
|
+
found = true
|
94
|
+
break
|
95
|
+
end
|
96
|
+
end
|
97
|
+
break if found
|
98
|
+
end
|
99
|
+
else
|
100
|
+
puts " Found at: #{hyperlist_path}"
|
101
|
+
if File.executable?(hyperlist_path)
|
102
|
+
puts " OK: File is executable"
|
103
|
+
else
|
104
|
+
puts " ERROR: File is not executable"
|
105
|
+
puts " Fix: chmod +x #{hyperlist_path}"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# Test basic dependencies WITHOUT loading rcurses
|
110
|
+
puts "\n5. Core Ruby Dependencies:"
|
111
|
+
deps = ['io/console', 'date', 'cgi', 'openssl', 'digest', 'base64']
|
112
|
+
deps.each do |dep|
|
113
|
+
begin
|
114
|
+
require dep
|
115
|
+
puts " OK: #{dep}"
|
116
|
+
rescue LoadError => e
|
117
|
+
puts " MISSING: #{dep} - #{e.message}"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
# Separate rcurses test with isolation
|
122
|
+
puts "\n6. Testing rcurses (isolated):"
|
123
|
+
puts " Running isolated test..."
|
124
|
+
|
125
|
+
# Create a separate test script to isolate rcurses
|
126
|
+
test_script = <<~RUBY
|
127
|
+
begin
|
128
|
+
require 'rcurses'
|
129
|
+
puts "RCURSES_LOAD:OK"
|
130
|
+
|
131
|
+
# Check if main classes exist without initializing
|
132
|
+
if defined?(Rcurses::Pane)
|
133
|
+
puts "RCURSES_PANE:OK"
|
134
|
+
else
|
135
|
+
puts "RCURSES_PANE:FAIL"
|
136
|
+
end
|
137
|
+
rescue LoadError => e
|
138
|
+
puts "RCURSES_LOAD:FAIL:\#{e.message}"
|
139
|
+
rescue => e
|
140
|
+
puts "RCURSES_ERROR:\#{e.class}:\#{e.message}"
|
141
|
+
end
|
142
|
+
RUBY
|
143
|
+
|
144
|
+
# Run test in subprocess to avoid terminal corruption
|
145
|
+
result = `ruby -e "#{test_script}" 2>&1`
|
146
|
+
|
147
|
+
if result.include?("RCURSES_LOAD:OK")
|
148
|
+
puts " OK: rcurses loads successfully"
|
149
|
+
else
|
150
|
+
puts " ERROR: rcurses failed to load"
|
151
|
+
error = result.match(/RCURSES_LOAD:FAIL:(.+)/)
|
152
|
+
puts " Details: #{error[1]}" if error
|
153
|
+
end
|
154
|
+
|
155
|
+
if result.include?("RCURSES_PANE:OK")
|
156
|
+
puts " OK: Rcurses::Pane class available"
|
157
|
+
else
|
158
|
+
puts " ERROR: Rcurses::Pane class not found"
|
159
|
+
end
|
160
|
+
|
161
|
+
if result.include?("RCURSES_ERROR")
|
162
|
+
error = result.match(/RCURSES_ERROR:(.+):(.+)/)
|
163
|
+
puts " ERROR: #{error[1]} - #{error[2]}" if error
|
164
|
+
end
|
165
|
+
|
166
|
+
# Test terminal sanity
|
167
|
+
puts "\n7. Terminal State Check:"
|
168
|
+
system("stty -a > /dev/null 2>&1")
|
169
|
+
if $?.success?
|
170
|
+
puts " OK: Terminal responds to stty"
|
171
|
+
else
|
172
|
+
puts " ERROR: Terminal not responding properly"
|
173
|
+
end
|
174
|
+
|
175
|
+
# Try to restore terminal just in case
|
176
|
+
system("stty sane 2>/dev/null")
|
177
|
+
system("tput reset 2>/dev/null")
|
178
|
+
|
179
|
+
puts "\n" + "=" * 60
|
180
|
+
puts "Diagnostic complete!"
|
181
|
+
puts "=" * 60
|
182
|
+
|
183
|
+
puts "\nRECOMMENDATIONS:"
|
184
|
+
if RUBY_VERSION >= "3.4.0"
|
185
|
+
puts "1. IMPORTANT: You're using Ruby #{RUBY_VERSION} (development version)"
|
186
|
+
puts " Install Ruby 3.3.x for stability:"
|
187
|
+
puts " - Arch Linux: sudo pacman -S ruby"
|
188
|
+
puts " - Or use: rbenv install 3.3.4"
|
189
|
+
end
|
190
|
+
|
191
|
+
puts "\nTo test rcurses isolation:"
|
192
|
+
puts " ruby -e \"require 'rcurses'; puts 'Loaded OK'\""
|
193
|
+
|
194
|
+
puts "\nTo restore terminal if corrupted:"
|
195
|
+
puts " stty sane"
|
196
|
+
puts " reset"
|
197
|
+
|
198
|
+
puts "\nPlease share this diagnostic output when reporting issues."
|
data/fix_terminal.sh
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Terminal restoration script for when things go wrong
|
3
|
+
|
4
|
+
echo "Restoring terminal to sane state..."
|
5
|
+
|
6
|
+
# Reset terminal to sane defaults
|
7
|
+
stty sane 2>/dev/null
|
8
|
+
|
9
|
+
# Clear any raw mode settings
|
10
|
+
stty echo 2>/dev/null
|
11
|
+
stty icanon 2>/dev/null
|
12
|
+
stty icrnl 2>/dev/null
|
13
|
+
|
14
|
+
# Reset terminal completely
|
15
|
+
tput reset 2>/dev/null
|
16
|
+
reset 2>/dev/null
|
17
|
+
|
18
|
+
# Clear screen
|
19
|
+
clear
|
20
|
+
|
21
|
+
# Show cursor
|
22
|
+
tput cnorm 2>/dev/null
|
23
|
+
echo -e "\033[?25h" # ANSI escape to show cursor
|
24
|
+
|
25
|
+
echo "Terminal restored!"
|
26
|
+
echo ""
|
27
|
+
echo "If your terminal is still broken, try:"
|
28
|
+
echo " 1. Close and reopen your terminal"
|
29
|
+
echo " 2. Run: reset"
|
30
|
+
echo " 3. Run: stty sane"
|
31
|
+
echo ""
|
32
|
+
echo "To check terminal state:"
|
33
|
+
echo " stty -a"
|
data/hyperlist
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
# Check for help/version BEFORE loading any libraries
|
8
8
|
if ARGV[0] == '-h' || ARGV[0] == '--help'
|
9
9
|
puts <<~HELP
|
10
|
-
HyperList v1.1.
|
10
|
+
HyperList v1.1.5 - Terminal User Interface for HyperList files
|
11
11
|
|
12
12
|
USAGE
|
13
13
|
hyperlist [OPTIONS] [FILE]
|
@@ -52,7 +52,7 @@ if ARGV[0] == '-h' || ARGV[0] == '--help'
|
|
52
52
|
HELP
|
53
53
|
exit 0
|
54
54
|
elsif ARGV[0] == '-v' || ARGV[0] == '--version'
|
55
|
-
puts "HyperList v1.1.
|
55
|
+
puts "HyperList v1.1.5"
|
56
56
|
exit 0
|
57
57
|
end
|
58
58
|
|
@@ -70,7 +70,7 @@ class HyperListApp
|
|
70
70
|
include Rcurses::Input
|
71
71
|
include Rcurses::Cursor
|
72
72
|
|
73
|
-
VERSION = "1.1.
|
73
|
+
VERSION = "1.1.5"
|
74
74
|
|
75
75
|
def initialize(filename = nil)
|
76
76
|
@filename = filename ? File.expand_path(filename) : nil
|
@@ -706,7 +706,7 @@ class HyperListApp
|
|
706
706
|
line = " " * item["level"] # 4 spaces per level
|
707
707
|
|
708
708
|
# Add fold indicator
|
709
|
-
real_idx =
|
709
|
+
real_idx = get_real_index(item)
|
710
710
|
if real_idx && has_children?(real_idx, @items) && item["fold"]
|
711
711
|
color = (@presentation_mode && !is_item_in_presentation_focus?(item)) ? "240" : "245"
|
712
712
|
line += "▶".fg(color) + " "
|
@@ -1111,7 +1111,10 @@ class HyperListApp
|
|
1111
1111
|
next
|
1112
1112
|
end
|
1113
1113
|
|
1114
|
-
|
1114
|
+
# Store the item with its real index to avoid lookup issues
|
1115
|
+
item_with_index = item.dup
|
1116
|
+
item_with_index["_real_index"] = idx
|
1117
|
+
visible << item_with_index
|
1115
1118
|
|
1116
1119
|
if item["fold"] && has_children?(idx, @items)
|
1117
1120
|
# Skip children if folded
|
@@ -1129,6 +1132,12 @@ class HyperListApp
|
|
1129
1132
|
visible
|
1130
1133
|
end
|
1131
1134
|
|
1135
|
+
# Helper method to get the real index from a visible item
|
1136
|
+
def get_real_index(visible_item)
|
1137
|
+
return nil unless visible_item
|
1138
|
+
visible_item["_real_index"] || @items.index(visible_item)
|
1139
|
+
end
|
1140
|
+
|
1132
1141
|
def has_children?(idx, items)
|
1133
1142
|
return false if idx >= items.length - 1
|
1134
1143
|
return false if idx < 0
|
@@ -1219,7 +1228,7 @@ class HyperListApp
|
|
1219
1228
|
return if @current >= visible.length
|
1220
1229
|
|
1221
1230
|
item = visible[@current]
|
1222
|
-
real_idx =
|
1231
|
+
real_idx = get_real_index(item)
|
1223
1232
|
|
1224
1233
|
if real_idx && has_children?(real_idx, @items)
|
1225
1234
|
@items[real_idx]["fold"] = !@items[real_idx]["fold"]
|
@@ -1385,7 +1394,7 @@ class HyperListApp
|
|
1385
1394
|
# Remember which item we're focused on
|
1386
1395
|
current_item = visible_items[@current]
|
1387
1396
|
current_level = current_item["level"]
|
1388
|
-
current_real_idx =
|
1397
|
+
current_real_idx = get_real_index(current_item)
|
1389
1398
|
|
1390
1399
|
# First, fold everything
|
1391
1400
|
@items.each_with_index do |item, idx|
|
@@ -1602,7 +1611,7 @@ class HyperListApp
|
|
1602
1611
|
visible = get_visible_items
|
1603
1612
|
if @current < visible.length
|
1604
1613
|
level = visible[@current]["level"]
|
1605
|
-
real_idx =
|
1614
|
+
real_idx = get_real_index(visible[@current])
|
1606
1615
|
@items.insert(real_idx + 1, {"text" => text, "level" => level, "fold" => false})
|
1607
1616
|
else
|
1608
1617
|
@items << {"text" => text, "level" => 0, "fold" => false}
|
@@ -1633,7 +1642,7 @@ class HyperListApp
|
|
1633
1642
|
visible = get_visible_items
|
1634
1643
|
if @current < visible.length
|
1635
1644
|
level = visible[@current]["level"] + 1
|
1636
|
-
real_idx =
|
1645
|
+
real_idx = get_real_index(visible[@current])
|
1637
1646
|
|
1638
1647
|
# Unfold parent if needed
|
1639
1648
|
@items[real_idx]["fold"] = false
|
@@ -1651,7 +1660,7 @@ class HyperListApp
|
|
1651
1660
|
return if @current >= visible.length
|
1652
1661
|
|
1653
1662
|
item = visible[@current]
|
1654
|
-
real_idx =
|
1663
|
+
real_idx = get_real_index(item)
|
1655
1664
|
|
1656
1665
|
@mode = :insert
|
1657
1666
|
|
@@ -1672,7 +1681,7 @@ class HyperListApp
|
|
1672
1681
|
return if @current >= visible.length
|
1673
1682
|
|
1674
1683
|
item = visible[@current]
|
1675
|
-
real_idx =
|
1684
|
+
real_idx = get_real_index(item)
|
1676
1685
|
|
1677
1686
|
save_undo_state # Save state before modification
|
1678
1687
|
@items[real_idx]["text"] = text
|
@@ -1688,7 +1697,7 @@ class HyperListApp
|
|
1688
1697
|
save_undo_state # Save state before modification
|
1689
1698
|
|
1690
1699
|
item = visible[@current]
|
1691
|
-
real_idx =
|
1700
|
+
real_idx = get_real_index(item)
|
1692
1701
|
|
1693
1702
|
# First, yank the item(s) to clipboard
|
1694
1703
|
@clipboard = []
|
@@ -1742,7 +1751,7 @@ class HyperListApp
|
|
1742
1751
|
return if @current >= visible.length
|
1743
1752
|
|
1744
1753
|
item = visible[@current]
|
1745
|
-
real_idx =
|
1754
|
+
real_idx = get_real_index(item)
|
1746
1755
|
|
1747
1756
|
@clipboard = []
|
1748
1757
|
@clipboard << item.dup
|
@@ -1771,7 +1780,7 @@ class HyperListApp
|
|
1771
1780
|
|
1772
1781
|
visible = get_visible_items
|
1773
1782
|
if @current < visible.length
|
1774
|
-
real_idx =
|
1783
|
+
real_idx = get_real_index(visible[@current])
|
1775
1784
|
|
1776
1785
|
if @clipboard_is_tree
|
1777
1786
|
# For tree paste (C-D or Y), maintain original indentation structure
|
@@ -1810,7 +1819,7 @@ class HyperListApp
|
|
1810
1819
|
save_undo_state # Save state before modification
|
1811
1820
|
|
1812
1821
|
item = visible[@current]
|
1813
|
-
real_idx =
|
1822
|
+
real_idx = get_real_index(item)
|
1814
1823
|
|
1815
1824
|
# Can't move if already at the beginning
|
1816
1825
|
return if real_idx == 0
|
@@ -1852,7 +1861,7 @@ class HyperListApp
|
|
1852
1861
|
save_undo_state # Save state before modification
|
1853
1862
|
|
1854
1863
|
item = visible[@current]
|
1855
|
-
real_idx =
|
1864
|
+
real_idx = get_real_index(item)
|
1856
1865
|
|
1857
1866
|
# Collect item(s) to move
|
1858
1867
|
items_to_move = [item]
|
@@ -1896,7 +1905,7 @@ class HyperListApp
|
|
1896
1905
|
return if @current >= visible.length
|
1897
1906
|
|
1898
1907
|
item = visible[@current]
|
1899
|
-
real_idx =
|
1908
|
+
real_idx = get_real_index(item)
|
1900
1909
|
|
1901
1910
|
# Can only indent if there's a previous item at same or higher level
|
1902
1911
|
if real_idx > 0
|
@@ -1925,7 +1934,7 @@ class HyperListApp
|
|
1925
1934
|
return if @current >= visible.length
|
1926
1935
|
|
1927
1936
|
item = visible[@current]
|
1928
|
-
real_idx =
|
1937
|
+
real_idx = get_real_index(item)
|
1929
1938
|
|
1930
1939
|
if @items[real_idx]["level"] > 0
|
1931
1940
|
save_undo_state # Save state before modification
|
@@ -1955,7 +1964,7 @@ class HyperListApp
|
|
1955
1964
|
save_undo_state # Save state before modification
|
1956
1965
|
|
1957
1966
|
item = visible[@current]
|
1958
|
-
real_idx =
|
1967
|
+
real_idx = get_real_index(item)
|
1959
1968
|
text = @items[real_idx]["text"]
|
1960
1969
|
|
1961
1970
|
if text =~ /^\[.\]/
|
@@ -1984,7 +1993,7 @@ class HyperListApp
|
|
1984
1993
|
save_undo_state # Save state before modification
|
1985
1994
|
|
1986
1995
|
item = visible[@current]
|
1987
|
-
real_idx =
|
1996
|
+
real_idx = get_real_index(item)
|
1988
1997
|
text = @items[real_idx]["text"]
|
1989
1998
|
|
1990
1999
|
# First, handle existing timestamp in the hyperlist.vim format
|
@@ -4197,7 +4206,7 @@ class HyperListApp
|
|
4197
4206
|
@marks ||= {}
|
4198
4207
|
visible = get_visible_items
|
4199
4208
|
if @current < visible.length
|
4200
|
-
real_idx =
|
4209
|
+
real_idx = get_real_index(visible[@current])
|
4201
4210
|
@marks[mark] = real_idx
|
4202
4211
|
@message = "Mark '#{mark}' set"
|
4203
4212
|
end
|
@@ -4212,7 +4221,7 @@ class HyperListApp
|
|
4212
4221
|
# Find the marked item in visible items
|
4213
4222
|
target_idx = @marks[mark]
|
4214
4223
|
visible = get_visible_items
|
4215
|
-
visible_idx = visible.find_index { |item|
|
4224
|
+
visible_idx = visible.find_index { |item| get_real_index(item) == target_idx }
|
4216
4225
|
|
4217
4226
|
if visible_idx
|
4218
4227
|
@current = visible_idx
|
@@ -4348,13 +4357,13 @@ class HyperListApp
|
|
4348
4357
|
when "o"
|
4349
4358
|
visible = get_visible_items
|
4350
4359
|
if @current < visible.length
|
4351
|
-
real_idx =
|
4360
|
+
real_idx = get_real_index(visible[@current])
|
4352
4361
|
@items[real_idx]["fold"] = false if real_idx
|
4353
4362
|
end
|
4354
4363
|
when "c"
|
4355
4364
|
visible = get_visible_items
|
4356
4365
|
if @current < visible.length
|
4357
|
-
real_idx =
|
4366
|
+
real_idx = get_real_index(visible[@current])
|
4358
4367
|
if real_idx && has_children?(real_idx, @items)
|
4359
4368
|
@items[real_idx]["fold"] = true
|
4360
4369
|
end
|
data/hyperlist.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "hyperlist"
|
3
|
-
spec.version = "1.1.
|
3
|
+
spec.version = "1.1.5"
|
4
4
|
spec.authors = ["Geir Isene"]
|
5
5
|
spec.email = ["g@isene.com"]
|
6
6
|
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.require_paths = ["."]
|
29
29
|
|
30
30
|
# Runtime dependencies
|
31
|
-
spec.add_runtime_dependency "rcurses", "~> 5.1", ">= 5.1.
|
31
|
+
spec.add_runtime_dependency "rcurses", "~> 5.1", ">= 5.1.5"
|
32
32
|
|
33
33
|
# Development dependencies
|
34
34
|
spec.add_development_dependency "minitest", "~> 5.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperlist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.1'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 5.1.
|
22
|
+
version: 5.1.5
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.1'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 5.1.
|
32
|
+
version: 5.1.5
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: minitest
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,6 +73,10 @@ files:
|
|
73
73
|
- CHANGELOG.md
|
74
74
|
- LICENSE
|
75
75
|
- README.md
|
76
|
+
- debug_instructions.md
|
77
|
+
- diagnose.rb
|
78
|
+
- diagnose_safe.rb
|
79
|
+
- fix_terminal.sh
|
76
80
|
- hyperlist
|
77
81
|
- hyperlist.gemspec
|
78
82
|
- hyperlist_logo.svg
|