rtfm-filemanager 1.4.0 → 1.5.3

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 +38 -18
  3. metadata +5 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cb8c1afd7b4f2cf1ab8175432956159e52dc715f25568cc7882c7ee0f5358d0
4
- data.tar.gz: efd18775dfbfe3e7a8780b4e971b116b73d278cc63f7dd8a17dfdedadaa97120
3
+ metadata.gz: b6f194c1fffc6901d52041ffe687b4880cbd948a150a6917dc2c181c65aaf674
4
+ data.tar.gz: fe7bc722683be3375c84897c3128e09149f839859a3ae3246dcac8611c6f5643
5
5
  SHA512:
6
- metadata.gz: 9975653d0d5b99418cf0f710bcfa8f314489cd5b9f4369f47f69a41ee2979be0645a1570e83f8eaba322f29d6a0560ba97d40a7607f3608a44007819ebed8dd9
7
- data.tar.gz: 78cbd09e08d1c8754ad75fc5b1cd8ad7e8e8b79df56259822234778abe0152042fddd33a82425876ba6704a9ee8533cd5176d97100db86725fbce92503adb23a
6
+ metadata.gz: d5a6d8051cb8d64e426db0b35a7b88aeba64b493e1b99a0ba6659d214cd2510d79dc5b62786eb1b57d8d8c6980465e8f150441d8e265f1ed71a5ea9c59d04e32
7
+ data.tar.gz: 56f1089b663786fe0d5aaefc73db51a446500c5f2807ba76baadc014f143c6b6a88bd3e3a6610326c171ee1f84abd945d684935804e950d8786070e6acbfc4fd
data/bin/rtfm CHANGED
@@ -46,8 +46,9 @@ JUMPING AND MARKS
46
46
  Press '-' and a letter to delete that mark
47
47
  M = Show marked items in right pane
48
48
  ' = Jump to mark (next letter is the name of the mark [a-zA-Z'])
49
- j = Jump to the item in the left pane that matches the entry
50
- J = Jump to the next matched item (as entered via 'j') if any
49
+ / = Enter search string in bottom window to highlight matching items and jump to the first match
50
+ n = Jump to the next item matched by '/'
51
+ N = Jump to the previous item matched by '/'
51
52
  h = Jump to Home directory
52
53
  f = Follow symlink to the directory where the target resides
53
54
  L = Start 'locate' search for files, then use '#' to jump to desired line/directory
@@ -84,7 +85,6 @@ RIGHT PANE
84
85
  - = Toggle preview in right pane (turn it off for faster traversing of directories)
85
86
 
86
87
  ADDITINAL COMMANDS
87
- / = Enter search string in bottom window to highlight matching items
88
88
  g = Run 'grep' to show files that contains the MATCH in current directory
89
89
  : = Enter "command mode" in bottom window (press ENTER to execute, press Ctrl-G to escape)
90
90
  ; = Show command history in right pane
@@ -172,7 +172,6 @@ begin # BASIC SETUP
172
172
  ## These should not be set by user in .rtfm.conf
173
173
  @directory = {} # Initialize the directory hash for remembering directories visited
174
174
  @searched = "" # Initialize the active searched for items
175
- @jump = "" # Initialize the "jump-to-file"
176
175
  @index = 0 # Set chosen item to first on startup
177
176
  @marks["'"] = Dir.pwd
178
177
  ## File type recognizers
@@ -620,23 +619,34 @@ def main_getkey # GET KEY FROM USER
620
619
  @break = true
621
620
  @w_b.update = true
622
621
  # ADDITIONAL COMMANDS
623
- when 'j' # Get the jump-to-file in the current dir from input
622
+ when '/' # Get search string to mark items that match the input
624
623
  @w_b.nohistory = true
625
- @jump = w_b_getstr("Jump to: ", @jump)
624
+ @searched = w_b_getstr("/ ", "")
626
625
  l = `ls #{@lsbase} #{@lsall} #{@lsorder} #{@lsinvert} #{@lsuser}`.split
627
- m = l.each_index.select{|n| l[n] =~ /#{@jump}/}
626
+ m = l.each_index.select{|n| l[n] =~ /#{@searched}/}
628
627
  i = m.find { |n| n > @index }
629
628
  @index = i if i > @index unless i == nil
629
+ @index = 0 if @searched == ""
630
630
  @w_r.update = true
631
- when 'J'
631
+ when 'n'
632
632
  l = `ls #{@lsbase} #{@lsall} #{@lsorder} #{@lsinvert} #{@lsuser}`.split
633
- m = l.each_index.select{|n| l[n] =~ /#{@jump}/}
633
+ m = l.each_index.select{|n| l[n] =~ /#{@searched}/}
634
634
  i = m.find { |n| n > @index }
635
- @index = i if i > @index 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
- when '/' # Get search string to mark items that match the input
638
- @w_b.nohistory = true
639
- @searched = w_b_getstr("/ ", "")
641
+ when 'N'
642
+ l = `ls #{@lsbase} #{@lsall} #{@lsorder} #{@lsinvert} #{@lsuser}`.split
643
+ m = l.each_index.select{|n| l[n] =~ /#{@searched}/}.reverse
644
+ i = m.find { |n| n < @index }
645
+ if i == nil
646
+ @index = m.first
647
+ else
648
+ @index = i
649
+ end
640
650
  @w_r.update = true
641
651
  when ':' # Enter "command mode" in the bottom window - tries to execute the given command
642
652
  @w_r.nohistory = false
@@ -662,14 +672,17 @@ def main_getkey # GET KEY FROM USER
662
672
  when '@' # Enter "Ruby debug"
663
673
  @w_b.nohistory = true
664
674
  cmd = w_b_getstr("◆ ", "")
675
+ @w_b.clr
676
+ @w_b.refresh
677
+ @w_b.update = true
665
678
  @w_r.clr
666
- @w_r << "Command: #{cmd}\n\n"
667
- @w_r.refresh
679
+ info = "Command: #{cmd}\n\n"
668
680
  begin
669
- eval(cmd)
681
+ info += eval(cmd).to_s
670
682
  rescue StandardError => e
671
- w_r_info("Error: #{e.inspect}")
683
+ info += "Error: #{e.inspect}"
672
684
  end
685
+ w_r_info(info)
673
686
  @w_r.update = false
674
687
  end
675
688
  if @w_r.update == true
@@ -983,12 +996,19 @@ def w_r_doc # GET FULL CONTENT TO PAGE
983
996
  @w_r << @w_r.text
984
997
  end
985
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")
986
1007
  @w_r.text = info
987
1008
  @w_r.pager_cmd = ""
988
1009
  pager_start
989
1010
  pager_show
990
1011
  @w_r.update = false
991
- image_show("clear") if @image; @image = false
992
1012
  end
993
1013
  def marks_info # SHOW MARKS IN RIGHT WINDOW
994
1014
  info = "MARKS:\n"
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.4.0
4
+ version: 1.5.3
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-13 00:00:00.000000000 Z
11
+ date: 2021-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -33,8 +33,9 @@ dependencies:
33
33
  description: 'A full featured terminal browser with syntax highlighted files, images
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
- other features. New in 1.4.0: Added jumping to an item in the current dir via the
37
- ''j'' and ''J'' keys.'
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.3: Fixed
38
+ output of Ruby commands (via the ''@'' key)'
38
39
  email: g@isene.com
39
40
  executables:
40
41
  - rtfm