rtfm-filemanager 7.3.2 → 7.3.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 +53 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ad1d9581fc33576497a4af185ce404251e71e1df5e6f080cf19b3e29fb8eb41
4
- data.tar.gz: 2007300af7b17fdb161c2510f6d8594a169e5f7001f7ff0e17d73524e8bded4b
3
+ metadata.gz: 569164f3c97c0f0bdb82f942745574d135471984648f7abfa9bdb59a7172b9d5
4
+ data.tar.gz: 7753dae5080cf46b422f73cc9fcf70f5cd962e8d5a0c66bcac52eaff39dbd39b
5
5
  SHA512:
6
- metadata.gz: fb256db6d25e7b19474f425282c5d2d012cd2380bff08bb5e78665aed9c4f2dd5ebdf416c2e13cabe5a78ef446e68b3bbc6d587e5f81a7bffa68d7fcd24a105d
7
- data.tar.gz: b3972f6e8a57d02478384b65b83a5ee3222b633a37cf10381511b0b50dbc838e9dbd6df00d3872c937ad1aa94dbceaee489d944ac1bbf995ad22e4ac39eed69e
6
+ metadata.gz: ea542ce3837d322bfd9d93ba98edac063f89ae8b8c3447ceb6f444ddd84abd362949696a25895a77eed8cecb28ed1917ab06d3e75a2635cbdabad899aa491cdc
7
+ data.tar.gz: f3b24e4b77de0d0b319d8b14d264f820292acb3c7739d7f52c8692d6da535eb7a6251c5c97d551d575299c46bac40411a98532203b2f8c1d485dca1bb440b1f9
data/bin/rtfm CHANGED
@@ -18,7 +18,7 @@
18
18
  # get a great understanding of the code itself by simply sending
19
19
  # or pasting this whole file into you favorite AI for coding with
20
20
  # a prompt like this: "Help me understand every part of this code".
21
- @version = '7.3.2' # Image persistence and C-Y copies images
21
+ @version = '7.3.3' # Performance optimization and UTF-16 support
22
22
 
23
23
  # SAVE & STORE TERMINAL {{{1
24
24
  ORIG_STTY = `stty -g`.chomp
@@ -1043,10 +1043,12 @@ end
1043
1043
  # MAIN GETKEY FOR USER INPUT {{{2
1044
1044
  def getkey # {{{3
1045
1045
  chr = getchr(1)
1046
-
1047
- # Check for image redraw on focus regain (even if no key was pressed)
1048
- check_image_redraw if @showimage
1049
-
1046
+
1047
+ # Only check image redraw when idle (no keypress) to avoid delays during active use
1048
+ if chr.nil? && @showimage
1049
+ check_image_redraw
1050
+ end
1051
+
1050
1052
  return unless chr
1051
1053
 
1052
1054
  # Don't clear image here - let render system handle it when @pR.update is true
@@ -1065,6 +1067,7 @@ end
1065
1067
 
1066
1068
  # BASIC KEYS {{{2
1067
1069
  def show_help # {{{3
1070
+ clear_image
1068
1071
  help_info
1069
1072
  end
1070
1073
 
@@ -1146,6 +1149,7 @@ def refresh_all # {{{3
1146
1149
  end
1147
1150
 
1148
1151
  def show_config
1152
+ clear_image
1149
1153
  @pR.say('Configuration'.u.fg(254) + ":\n\n" + @conf.fg(249))
1150
1154
  end
1151
1155
 
@@ -2242,6 +2246,7 @@ end
2242
2246
 
2243
2247
  # FILE COMPARISON {{{2
2244
2248
  def compare_files # {{{3
2249
+ clear_image
2245
2250
  if @tagged.length == 0
2246
2251
  @pB.say("No files tagged for comparison. Tag 2 files with 't'".fg(196))
2247
2252
  return
@@ -3265,12 +3270,15 @@ def delete_items # {{{3
3265
3270
 
3266
3271
  tagged_info
3267
3272
 
3273
+ # Clear image before showing warning text
3274
+ clear_image
3275
+
3268
3276
  # Add deletion warning to the right pane
3269
3277
  warning_text = "\n" + "=" * 50 + "\n"
3270
3278
  action = @trash ? 'Move to Trash' : 'PERMANENT DELETE'
3271
3279
  action_color = @trash ? 220 : 196
3272
3280
  warning_text << action.fg(action_color).b + "\n\n"
3273
-
3281
+
3274
3282
  if @trash
3275
3283
  warning_text << "Items will be moved to:\n".fg(249)
3276
3284
  warning_text << " ~/.rtfm/trash/\n".fg(240)
@@ -3280,9 +3288,9 @@ def delete_items # {{{3
3280
3288
  warning_text << "Files will be permanently removed\n".fg(196)
3281
3289
  warning_text << "This action CANNOT be undone!\n".fg(196).b
3282
3290
  end
3283
-
3291
+
3284
3292
  warning_text << "\n" + "Press " + "y".fg(156).b + " to confirm, any other key to cancel".fg(249)
3285
-
3293
+
3286
3294
  @pR.text << warning_text
3287
3295
  @pR.refresh
3288
3296
 
@@ -3643,8 +3651,9 @@ end
3643
3651
 
3644
3652
  # GIT/HASH/OPENAI {{{2
3645
3653
  def git_status # {{{3
3654
+ clear_image
3646
3655
  @pR.clear
3647
-
3656
+
3648
3657
  # Check if we're in a git repository
3649
3658
  unless Dir.exist?('.git') || system('git rev-parse --git-dir > /dev/null 2>&1')
3650
3659
  @pR.say("Not a Git Repository".b.fg(196) + "\n\n" + "This directory is not under Git version control.".fg(240))
@@ -3975,6 +3984,7 @@ end
3975
3984
 
3976
3985
  # SYSTEM SHORTCUTS {{{2
3977
3986
  def system_info # {{{3
3987
+ clear_image
3978
3988
  text = "SYSTEM INFORMATION".b.fg(156) + " - " + Time.now.strftime("%Y-%m-%d %H:%M:%S").fg(249) + "\n"
3979
3989
  text << "=" * 50 + "\n\n"
3980
3990
 
@@ -4812,7 +4822,9 @@ def render # RENDER ALL PANES {{{2
4812
4822
 
4813
4823
  # RIGHT pane (or Preview pane in dual-pane mode) {{{3
4814
4824
  if @pR.update && @preview
4815
- showimage('clear') if @image; @image = false
4825
+ # Actually clear the image overlay when rendering new content
4826
+ showimage('clear') if @image
4827
+ @image = false
4816
4828
  righttext = @pR.text
4817
4829
 
4818
4830
  # In dual-pane mode, construct full path from active pane
@@ -5320,8 +5332,25 @@ def open_selected(html = nil) # OPEN SELECTED FILE {{{2
5320
5332
  end
5321
5333
  return
5322
5334
  end
5323
- # Don't try to read large files or PDFs as text for validation
5324
- if !@selected&.match(@pdffile) && File.size(@selected) < 1_000_000 && File.read(@selected).force_encoding('UTF-8').valid_encoding? # Pure text
5335
+ # Check if file is text (UTF-8, UTF-16, or other text encodings)
5336
+ is_text_file = false
5337
+ if !@selected&.match(@pdffile) && File.size(@selected) < 1_000_000
5338
+ sample = File.read(@selected, 1024) rescue nil
5339
+ if sample
5340
+ # Try UTF-8 first
5341
+ if sample.force_encoding('UTF-8').valid_encoding?
5342
+ is_text_file = true
5343
+ # Try UTF-16LE
5344
+ elsif sample.force_encoding('UTF-16LE').valid_encoding?
5345
+ is_text_file = true
5346
+ # Try UTF-16BE
5347
+ elsif sample.force_encoding('UTF-16BE').valid_encoding?
5348
+ is_text_file = true
5349
+ end
5350
+ end
5351
+ end
5352
+
5353
+ if is_text_file
5325
5354
  # Set flag to prevent SIGWINCH from refreshing during editor
5326
5355
  @external_program_running = true
5327
5356
  # Save terminal state before launching editor
@@ -5655,6 +5684,16 @@ def showcontent # SHOW CONTENTS IN THE RIGHT WINDOW {{{2
5655
5684
  @pR.update = false
5656
5685
  end
5657
5686
 
5687
+ def clear_image(skip_actual_clear: false) # HELPER TO CLEAR CURRENT IMAGE {{{2
5688
+ return unless @image
5689
+ # For operations that immediately render text over image, skip the slow clear
5690
+ # The text pane will cover the image overlay anyway
5691
+ unless skip_actual_clear
5692
+ showimage('clear')
5693
+ end
5694
+ @image = false
5695
+ end
5696
+
5658
5697
  def showimage(image) # SHOW THE SELECTED IMAGE IN THE RIGHT WINDOW {{{2
5659
5698
  # Pass 'clear' to clear the window for previous image
5660
5699
  return unless @showimage
@@ -5717,9 +5756,10 @@ def marks_info # SHOW MARKS IN RIGHT WINDOW {{{2
5717
5756
  end
5718
5757
 
5719
5758
  def tagged_info # SHOW THE LIST OF TAGGED ITEMS IN @pR {{{2
5759
+ clear_image
5720
5760
  info = "Tagged Items".b.fg(204) + "\n"
5721
5761
  info << "=" * 50 + "\n\n"
5722
-
5762
+
5723
5763
  # Summary information
5724
5764
  size_mb = (@tagsize.to_f / 1_000_000).round(2)
5725
5765
  info << "Summary:\n".fg(226)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtfm-filemanager
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.2
4
+ version: 7.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '7.4'
69
69
  description: |-
70
- RTFM v7.3.2: Image persistence during operations and C-Y copies images to clipboard.
70
+ RTFM v7.3.3: Performance optimization for image operations and UTF-16 file support.
71
71
  A full featured terminal browser with syntax highlighted files, images shown in the terminal, videos thumbnailed, etc. Features include remote SSH/SFTP browsing, interactive SSH shell, comprehensive undo system, bookmarks, and much more. You can bookmark and jump around easily, delete, rename, copy, symlink and move files. RTFM is one of the most feature-packed terminal file managers.
72
72
  email: g@isene.com
73
73
  executables: