rtfm-filemanager 3.10 → 3.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rtfm +22 -20
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '080c0934da9294dbad21bd902a119ae0dd533348f19eaa4841ac90f039741fb0'
4
- data.tar.gz: 3839a9ad45595ce3cdec6fd0c9e9e29bc97a268c7876b6e8df9d93a33a9f0ae9
3
+ metadata.gz: ebffa8209855842bb1f85971814b3596c48530543ea7840841e96698ae5043bd
4
+ data.tar.gz: 80ff8bf414f6349576d97ef8867f227737b1d58ca8e037255ac7d1c492a57ff5
5
5
  SHA512:
6
- metadata.gz: 112a9732a52ca5d42405daf9e6405d6c86d54d434bfdbebb4da7bba5a1ef7dbfedad6a9293a3c65531320c2b317ae8300c7b0d49ebe15a83b51f21f991d07f19
7
- data.tar.gz: e73ff6c29ee8e951bd255c21c2125b18431472f23d2e9a3876f5d738f8efd11748b4983ee34fd7ef5576e24c9d2c34ffe8fbd106ec4fd31b40668536d9818625
6
+ metadata.gz: 0055e265aa75f6aba0e8092550eea179fb232d98549fad0ea22c241e71c794fd2fb583ae7f3f0b629001823c924b8f38d9dc339d0dd83f24b3e851a2bc078493
7
+ data.tar.gz: 982c7e5a217e1d4f6700c9a1b1bfd3e6cb72650902251aea6613a8ea22d9c0560bfb4f4dc0fac7a88b1244f6f38f19356b3b4527537542844bc3b746552545ca
data/bin/rtfm CHANGED
@@ -14,7 +14,7 @@
14
14
  # for any damages resulting from its use. Further, I am under no
15
15
  # obligation to maintain or extend this software. It is provided
16
16
  # on an 'as is' basis without any expressed or implied warranty.
17
- @version = "3.10"
17
+ @version = "3.11"
18
18
 
19
19
  # PRELIMINARIES
20
20
  @help = <<HELPTEXT
@@ -1433,10 +1433,11 @@ def w_b_getstr(pretext, text) # A SIMPLE READLINE-LIKE ROUTINE
1433
1433
  @history.insert(stk, text)
1434
1434
  pos = @history[stk].length
1435
1435
  chr = ""
1436
+ @history_copy = @history.map(&:clone)
1436
1437
  while chr != "ENTER"
1437
1438
  @w_b.setpos(0,0)
1438
1439
  init_pair(250, 250, 238)
1439
- text = pretext + @history[stk]
1440
+ text = pretext + @history_copy[stk]
1440
1441
  text += " " * (@w_b.maxx - text.length) if text.length < @w_b.maxx
1441
1442
  @w_b.attron(color_pair(250)) { @w_b << text }
1442
1443
  @w_b.setpos(0,pretext.length + pos)
@@ -1451,50 +1452,50 @@ def w_b_getstr(pretext, text) # A SIMPLE READLINE-LIKE ROUTINE
1451
1452
  case chr
1452
1453
  when 'UP'
1453
1454
  unless @w_b.nohistory
1454
- unless stk == @history.length - 1
1455
+ unless stk == @history_copy.length - 1
1455
1456
  stk += 1
1456
- pos = @history[stk].length
1457
+ pos = @history_copy[stk].length
1457
1458
  end
1458
1459
  end
1459
1460
  when 'DOWN'
1460
1461
  unless @w_b.nohistory
1461
1462
  unless stk == 0
1462
1463
  stk -= 1
1463
- pos = @history[stk].length
1464
+ pos = @history_copy[stk].length
1464
1465
  end
1465
1466
  end
1466
1467
  when 'RIGHT'
1467
- pos += 1 unless pos > @history[stk].length
1468
+ pos += 1 unless pos > @history_copy[stk].length
1468
1469
  when 'LEFT'
1469
1470
  pos -= 1 unless pos == 0
1470
1471
  when 'HOME'
1471
1472
  pos = 0
1472
1473
  when 'END'
1473
- pos = @history[stk].length
1474
+ pos = @history_copy[stk].length
1474
1475
  when 'DEL'
1475
- @history[stk][pos] = ""
1476
+ @history_copy[stk][pos] = ""
1476
1477
  when 'BACK'
1477
1478
  unless pos == 0
1478
1479
  pos -= 1
1479
- @history[stk][pos] = ""
1480
+ @history_copy[stk][pos] = ""
1480
1481
  end
1481
1482
  when 'WBACK'
1482
1483
  unless pos == 0
1483
- until @history[stk][pos - 1] == " " or pos == 0
1484
+ until @history_copy[stk][pos - 1] == " " or pos == 0
1484
1485
  pos -= 1
1485
- @history[stk][pos] = ""
1486
+ @history_copy[stk][pos] = ""
1486
1487
  end
1487
- if @history[stk][pos - 1] == " "
1488
+ if @history_copy[stk][pos - 1] == " "
1488
1489
  pos -= 1
1489
- @history[stk][pos] = ""
1490
+ @history_copy[stk][pos] = ""
1490
1491
  end
1491
1492
  end
1492
1493
  when 'LDEL'
1493
- @history[stk] = ""
1494
+ @history_copy[stk] = ""
1494
1495
  pos = 0
1495
1496
  when 'TAB' # Tab completion of dirs and files
1496
1497
  p1 = pos - 1
1497
- c = @history[stk][0..(p1)].sub(/^.* /, '')
1498
+ c = @history_copy[stk][0..(p1)].sub(/^.* /, '')
1498
1499
  p0 = p1 - c.length
1499
1500
  compl = File.expand_path(c)
1500
1501
  compl += "/" if Dir.exist?(compl)
@@ -1529,20 +1530,21 @@ def w_b_getstr(pretext, text) # A SIMPLE READLINE-LIKE ROUTINE
1529
1530
  Curses.echo
1530
1531
  end
1531
1532
  end
1532
- @history[stk].sub!(c,compl)
1533
+ @history_copy[stk].sub!(c,compl)
1533
1534
  pos = pos - c.length + compl.length
1534
1535
  when /^.$/
1535
- @history[stk].insert(pos,chr)
1536
+ @history_copy[stk].insert(pos,chr)
1536
1537
  pos += 1
1537
1538
  end
1538
1539
  while STDIN.ready?
1539
1540
  chr = STDIN.getc
1540
- @history[stk].insert(pos,chr)
1541
+ @history_copy[stk].insert(pos,chr)
1541
1542
  pos += 1
1542
1543
  end
1543
1544
  end
1544
- curstr = @history[stk]
1545
- @history.shift if @w_b.nohistory
1545
+ curstr = @history_copy[stk]
1546
+ @history_copy.shift if @w_b.nohistory
1547
+ @history.insert(0, @history_copy[stk])
1546
1548
  unless @w_b.nohistory
1547
1549
  @history.uniq!
1548
1550
  @history.compact!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtfm-filemanager
3
3
  version: !ruby/object:Gem::Version
4
- version: '3.10'
4
+ version: '3.11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-28 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -47,7 +47,7 @@ dependencies:
47
47
  description: 'A full featured terminal browser with syntax highlighted files, images
48
48
  shown in the terminal, videos thumbnailed, etc. You can bookmark and jump around
49
49
  easily, delete, rename, copy, symlink and move files. RTFM has a a wide range of
50
- other features. New in 3.10: Critical bugfix on syntax highlighting.'
50
+ other features. New in 3.11: Better history handling.'
51
51
  email: g@isene.com
52
52
  executables:
53
53
  - rtfm