rtfm-filemanager 1.8.2 → 1.8.6

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 +25 -15
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04d197c6aa33f350419d15ec6fdb9b380062a9811a5fcff79612f0f551011bdd
4
- data.tar.gz: 2b7054f5603f874f962fc9613e4bf971aa33b54d1ca7a530f69e2ff2dab96b85
3
+ metadata.gz: 7eb306ddf829a628bd06dedf480cf7b0844d45b469d26e4eb3841b9fafe951e7
4
+ data.tar.gz: dfd1c22e5a7df65e117182add0b5e65df37b3d991650ac98369a2baf5101f363
5
5
  SHA512:
6
- metadata.gz: 384b81bcd318651c396aa2a7a494f83bfe2f5ce005d0b3e45d4de815ebfc76dd95a3af989865edf0ca19010edcfaa577e70f62a72e8d83e7c84a53e16a963bbd
7
- data.tar.gz: b62bc3a32ae1d474cde2d9e35a3d0316779d9a527fbd8f4148a42c3cb316d3ae41413ec255f12e5d31f378a64fd1d80ce208a99418a3b0d93dd42ffc8ecd7dc0
6
+ metadata.gz: bbc7d5168d58d6578c24f541b538c31ba623a84e7e608b06430a3d8c4337633dc3459f019adfe1bde7c7af8926e2a61590628f4b9e8a5660de5341a023878ae7
7
+ data.tar.gz: 45eb939cc1a03eecc22e7c468c6e96afb080a96b749539b91665fd4975acc6c71b7340c1f55f5f7909fbbaa2fb3001cf43f606ef91205163dbcefa2d5070d381
data/bin/rtfm CHANGED
@@ -135,6 +135,7 @@ begin # BASIC SETUP
135
135
  def cmd?(command)
136
136
  system("which #{command} > /dev/null 2>&1")
137
137
  end
138
+
138
139
  if cmd?('/usr/lib/w3m/w3mimgdisplay')
139
140
  @w3mimgdisplay = "/usr/lib/w3m/w3mimgdisplay"
140
141
  @showimage = true
@@ -142,6 +143,8 @@ begin # BASIC SETUP
142
143
  @showimage = false
143
144
  end
144
145
  @showimage = false unless (cmd?('xwininfo') and cmd?('xdotool'))
146
+
147
+ cmd?('bat') ? @bat = "bat" : @bat = "batcat"
145
148
 
146
149
  STDIN.set_encoding(Encoding::UTF_8) # Set encoding for STDIN
147
150
  LScolors = `echo $LS_COLORS` # Import LS_COLORS
@@ -255,12 +258,19 @@ def getchr # PROCESS KEY PRESSES
255
258
  when 'C' then chr = "RIGHT"
256
259
  when 'D' then chr = "LEFT"
257
260
  when 'Z' then chr = "S-TAB"
258
- when '2' then chr = "INS" ; STDIN.getc
259
- when '3' then chr = "DEL" ; STDIN.getc
260
- when '5' then chr = "PgUP" ; STDIN.getc
261
- when '6' then chr = "PgDOWN" ; STDIN.getc
262
- when '7' then chr = "HOME" ; STDIN.getc
263
- when '8' then chr = "END" ; STDIN.getc
261
+ when '2' then chr = "INS" ; chr = "C-INS" if STDIN.getc == "^"
262
+ when '3' then chr = "DEL" ; chr = "C-DEL" if STDIN.getc == "^"
263
+ when '5' then chr = "PgUP" ; chr = "C-PgUP" if STDIN.getc == "^"
264
+ when '6' then chr = "PgDOWN" ; chr = "C-PgDOWN" if STDIN.getc == "^"
265
+ when '7' then chr = "HOME" ; chr = "C-HOME" if STDIN.getc == "^"
266
+ when '8' then chr = "END" ; chr = "C-END" if STDIN.getc == "^"
267
+ end
268
+ when 'O' # Set Ctrl+ArrowKey equal to ArrowKey; May be used for other purposes in the future
269
+ case $stdin.getc
270
+ when 'a' then chr = "C-UP"
271
+ when 'b' then chr = "C-DOWN"
272
+ when 'c' then chr = "C-RIGHT"
273
+ when 'd' then chr = "C-LEFT"
264
274
  end
265
275
  end
266
276
  when "", "" then chr = "BACK"
@@ -302,17 +312,17 @@ def main_getkey # GET KEY FROM USER
302
312
  @write_conf = false
303
313
  exit 0
304
314
  # MOTION
305
- when 'DOWN', 'j'
315
+ when 'DOWN', 'j', 'C-DOWN'
306
316
  var_resets
307
317
  @index = @index >= @max_index ? @min_index : @index + 1
308
318
  @w_r.update = true
309
319
  @w_b.update = true
310
- when 'UP', 'k'
320
+ when 'UP', 'k', 'C-UP'
311
321
  var_resets
312
322
  @index = @index <= @min_index ? @max_index : @index - 1
313
323
  @w_r.update = true
314
324
  @w_b.update = true
315
- when 'LEFT', 'h'
325
+ when 'LEFT', 'h', 'C-LEFT'
316
326
  var_resets
317
327
  cur_dir = Dir.pwd
318
328
  @directory[Dir.pwd] = @selected # Store this directory before leaving
@@ -321,7 +331,7 @@ def main_getkey # GET KEY FROM USER
321
331
  @directory[Dir.pwd] = File.basename(cur_dir) unless @directory.key?(Dir.pwd)
322
332
  @w_r.update = true
323
333
  @w_b.update = true
324
- when 'RIGHT', 'l'
334
+ when 'RIGHT', 'l', 'C-RIGHT'
325
335
  var_resets
326
336
  @directory[Dir.pwd] = @selected # Store this directory before leaving
327
337
  mark_latest
@@ -603,7 +613,7 @@ def main_getkey # GET KEY FROM USER
603
613
  end
604
614
  # RIGHT PANE
605
615
  when 'ENTER' # Refresh right pane
606
- @w_r.clr # First clear the window, then clear any previously showing image
616
+ @w_r.fill # First clear the window, then clear any previously showing image
607
617
  image_show("clear") if @image; @image = false
608
618
  @w_r.update = true
609
619
  @w_b.update = true
@@ -961,8 +971,8 @@ def w_r_show # SHOW CONTENTS IN THE RIGHT WINDOW
961
971
  # TEXT
962
972
  elsif File.read(@selected).force_encoding("UTF-8").valid_encoding? and @w_r.pager == 0
963
973
  begin # View the file as text if it is utf-8
964
- @w_r.pager_cmd = "batcat -n --color=always #{@selected_safe} 2>/dev/null"
965
- @w_r.text = `batcat -n --color=always --line-range :#{@w_r.maxy} #{@selected_safe} 2>/dev/null`
974
+ @w_r.pager_cmd = "#{@bat} -n --color=always #{@selected_safe} 2>/dev/null"
975
+ @w_r.text = `#{@bat} -n --color=always --line-range :#{@w_r.maxy} #{@selected_safe} 2>/dev/null`
966
976
  pager_start
967
977
  syntax_highlight(@w_r.text)
968
978
  rescue
@@ -1302,10 +1312,10 @@ def w_b_exec(cmd) # EXECUTE COMMAND FROM @W_B
1302
1312
  return
1303
1313
  end
1304
1314
  begin
1305
- status = Timeout::timeout(5) {
1315
+ status = Timeout::timeout(15) {
1306
1316
  @w_r.clr
1307
1317
  begin
1308
- @w_r.pager_cmd = "#{cmd} | batcat -n --color=always 2>/dev/null"
1318
+ @w_r.pager_cmd = "#{cmd} | #{@bat} -n --color=always 2>/dev/null"
1309
1319
  @w_r.text = `#{@w_r.pager_cmd} 2>/dev/null`
1310
1320
  rescue
1311
1321
  @w_r.text = `#{cmd} 2>/dev/null`
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.8.2
4
+ version: 1.8.6
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-12-14 00:00:00.000000000 Z
11
+ date: 2022-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -33,7 +33,7 @@ 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.8.2: Reversed dmesg list in system overview (''S'')'
36
+ other features. New in 1.8.6: Fixed bug on paging commands like Locate.'
37
37
  email: g@isene.com
38
38
  executables:
39
39
  - rtfm