hyperlist 1.1.4 → 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/hyperlist +33 -24
- data/hyperlist.gemspec +1 -1
- metadata +1 -1
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
|
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