rtfm-filemanager 1.5.1 → 1.5.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rtfm +28 -9
  3. metadata +5 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58e367b107dab960575d391b4daa4995f4e53d8b838b38888ce1aadfe1687ce7
4
- data.tar.gz: a224584539c2160613a7886f836cbf71619c5aaef5aae36b77685467446402ac
3
+ metadata.gz: 2a28a340b9bef89f913d1133a7e9f3ba301e1b3f1662f5bd4f2ff07bb3a61c53
4
+ data.tar.gz: 36b80a48dcd9ffc61941809bd71fcc2b6202bdb9c25fbdac015f471b95c36fbf
5
5
  SHA512:
6
- metadata.gz: f9bb4987880cc5fef8d3fb12595e94cdb7ce215d4aa73b7dcf17290ace55da85317a8049a71db6099fbbc3b1e2e0b699a79b15a8aa676339e8de7699d0f783dd
7
- data.tar.gz: 31447f99d73dc8f039d6ea40231b1478045409d868adcbde6bc1149815c783fc51ed19b092c75bdbbb1997148f7f62751479ca694f0c218d630628ba964cc4c5
6
+ metadata.gz: a8d6bf8e99726cc2926bdc921094744c409f2adc790f0d346f8fba0c6cf3148461ec7a5a6d47f775369290f90a9bb9a5ff6cce1088bb6bc0cd6d0ffca412963f
7
+ data.tar.gz: febf4da32dabc8542ae0c48b2e61f28c79edd0e26e133dfa90a1f157761dd2656f0f71063c1cdaae1cd36b5f0efec2e7eb6781c3fa72c943bf7155b3adec49d2
data/bin/rtfm CHANGED
@@ -624,21 +624,29 @@ def main_getkey # GET KEY FROM USER
624
624
  @searched = w_b_getstr("/ ", "")
625
625
  l = `ls #{@lsbase} #{@lsall} #{@lsorder} #{@lsinvert} #{@lsuser}`.split
626
626
  m = l.each_index.select{|n| l[n] =~ /#{@searched}/}
627
+ @index = 0 unless m == []
627
628
  i = m.find { |n| n > @index }
628
629
  @index = i if i > @index unless i == nil
629
- @index = 0 if @searched == ""
630
630
  @w_r.update = true
631
631
  when 'n'
632
632
  l = `ls #{@lsbase} #{@lsall} #{@lsorder} #{@lsinvert} #{@lsuser}`.split
633
633
  m = l.each_index.select{|n| l[n] =~ /#{@searched}/}
634
634
  i = m.find { |n| n > @index }
635
- @index = i unless i == nil
635
+ if i == nil
636
+ @index = m.first
637
+ else
638
+ @index = i
639
+ end
636
640
  @w_r.update = true
637
641
  when 'N'
638
642
  l = `ls #{@lsbase} #{@lsall} #{@lsorder} #{@lsinvert} #{@lsuser}`.split
639
643
  m = l.each_index.select{|n| l[n] =~ /#{@searched}/}.reverse
640
644
  i = m.find { |n| n < @index }
641
- @index = i unless i == nil
645
+ if i == nil
646
+ @index = m.first
647
+ else
648
+ @index = i
649
+ end
642
650
  @w_r.update = true
643
651
  when ':' # Enter "command mode" in the bottom window - tries to execute the given command
644
652
  @w_r.nohistory = false
@@ -664,14 +672,17 @@ def main_getkey # GET KEY FROM USER
664
672
  when '@' # Enter "Ruby debug"
665
673
  @w_b.nohistory = true
666
674
  cmd = w_b_getstr("◆ ", "")
675
+ @w_b.clr
676
+ @w_b.refresh
677
+ @w_b.update = true
667
678
  @w_r.clr
668
- @w_r << "Command: #{cmd}\n\n"
669
- @w_r.refresh
679
+ info = "Command: #{cmd}\n\n"
670
680
  begin
671
- eval(cmd)
681
+ info += eval(cmd).to_s
672
682
  rescue StandardError => e
673
- w_r_info("Error: #{e.inspect}")
683
+ info += "Error: #{e.inspect}"
674
684
  end
685
+ w_r_info(info)
675
686
  @w_r.update = false
676
687
  end
677
688
  if @w_r.update == true
@@ -985,12 +996,19 @@ def w_r_doc # GET FULL CONTENT TO PAGE
985
996
  @w_r << @w_r.text
986
997
  end
987
998
  def w_r_info(info) # SHOW INFO IN THE RIGHT WINDOW
999
+ image_show("clear") if @image; @image = false
1000
+ @w_r.clr
1001
+ @w_r. refresh
1002
+ w_r_width = Curses.cols - (Curses.cols/@width) - 1
1003
+ info = info.split("\n")
1004
+ l = []
1005
+ info.each{ |e| l << e.scan(/.{,#{w_r_width}}/)[0..-2] }
1006
+ info = l.join("\n")
988
1007
  @w_r.text = info
989
1008
  @w_r.pager_cmd = ""
990
1009
  pager_start
991
1010
  pager_show
992
1011
  @w_r.update = false
993
- image_show("clear") if @image; @image = false
994
1012
  end
995
1013
  def marks_info # SHOW MARKS IN RIGHT WINDOW
996
1014
  info = "MARKS:\n"
@@ -1250,6 +1268,7 @@ def w_b_exec(cmd) # EXECUTE COMMAND FROM @W_B
1250
1268
  end
1251
1269
  begin
1252
1270
  status = Timeout::timeout(5) {
1271
+ @w_r.clr
1253
1272
  begin
1254
1273
  @w_r.pager_cmd = "#{cmd} | batcat -n --color=always 2>/dev/null"
1255
1274
  @w_r.text = `#{@w_r.pager_cmd} 2>/dev/null`
@@ -1354,8 +1373,8 @@ loop do # OUTER LOOP - CATCHING REFRESHES VIA 'r'
1354
1373
  @tag = false # Clear tag pattern
1355
1374
  lsall_old = @lsall
1356
1375
  main_getkey # Get key from user
1357
- break if @break # Break to outer loop, redrawing windows, if user hit 'r'
1358
1376
  break if Curses.cols != maxx or Curses.lines != maxy # break on terminal resize
1377
+ break if @break # Break to outer loop, redrawing windows, if user hit 'r'
1359
1378
  end
1360
1379
  ensure # On exit: close curses, clear terminal
1361
1380
  @write_conf_all = false
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: 1.5.1
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-14 00:00:00.000000000 Z
11
+ date: 2021-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -34,8 +34,9 @@ description: 'A full featured terminal browser with syntax highlighted files, im
34
34
  shown in the terminal, videos thumbnailed, etc. You can bookmark and jump around
35
35
  easily, delete, rename, copy, symlink and move files. RTFM has a a wide range of
36
36
  other features. New in 1.5.0: Expanded ''/'' to jump to the first match and ''n''
37
- to jump to the next matched item (''j'' and ''J'' are now gone). New in 1.5.1: Added
38
- ''N'' to jump to the previous matched item by ''/'''
37
+ to jump to the next matched item (''j'' and ''J'' are now gone). New in 1.5.4: Fixed
38
+ command output error - now shown in right pane. New in 1.5.5: Fixed minor jump issue
39
+ when searching via ''/'''
39
40
  email: g@isene.com
40
41
  executables:
41
42
  - rtfm