rtfm-filemanager 1.8.2 → 1.8.6
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/bin/rtfm +25 -15
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb306ddf829a628bd06dedf480cf7b0844d45b469d26e4eb3841b9fafe951e7
|
4
|
+
data.tar.gz: dfd1c22e5a7df65e117182add0b5e65df37b3d991650ac98369a2baf5101f363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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 = "
|
965
|
-
@w_r.text =
|
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(
|
1315
|
+
status = Timeout::timeout(15) {
|
1306
1316
|
@w_r.clr
|
1307
1317
|
begin
|
1308
|
-
@w_r.pager_cmd = "#{cmd} |
|
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.
|
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:
|
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.
|
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
|