sergeant 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80f83fe4916418417a546134baeff0c43e0daf5e383b39cdd49c77bdea88e3a3
4
- data.tar.gz: 6105effe9798842cf02bdb5b56e32b1b58e5838da3c66004b24da31365982758
3
+ metadata.gz: 31da9bd15ab6238af30e32ee9af80598fa98c2621a1d9d61c37bff4b59ba8e4f
4
+ data.tar.gz: ee04423f976b128d354565d4a3a7e262b40934c0c02f49af55bce6089408b16c
5
5
  SHA512:
6
- metadata.gz: a90c6c72ab39338aa0d27a603051a2fea99b97b9f9c0764f2cc3f59bde980c3310b0aa97015028543453e03b11d4fff62f162fc2ae716fa991a91090628bb680
7
- data.tar.gz: 845f119f78cfb9d08d4afa1abd6816195b630a16e2276cc59a7caab318a34e7fa15cb1984e6aa9a82c5f43e758894238740ba99a8490a8d676c9577b0560e78f
6
+ metadata.gz: 18dc7522e127b540a93b6c1383008e53bc5ae74b4ddcfdadda9d61f5df754b228637cd7e02a0f50df63f3ab3cc253cd2f868224e824c1b94b4bf958d4f71cae1
7
+ data.tar.gz: c0d31805d279d936c8d9575636a07e350cae4f0e5240469a87183deacd38544c11fd4ff7d797930b2f85a86b5ccd2dd21e683268c3610fcb9d9920508da3df01
data/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to Sergeant will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.1] - 2024-12-24
9
+
10
+ ### Fixed
11
+ - **Major performance improvement**: Fixed severe input lag with large directories
12
+ - Directory contents now only refresh when necessary (directory changes, file operations)
13
+ - Previously refreshed on every keystroke, causing thousands of unnecessary file system calls
14
+ - Navigation (arrow keys, marking) is now instant regardless of directory size
15
+ - **Better error handling**: Added error messages to help diagnose installation issues
16
+ - Shows load path and helpful reinstall instructions if gem fails to load
17
+ - Displays full error details instead of silently failing
18
+
8
19
  ## [1.0.0] - 2024-12-23
9
20
 
10
21
  ### Added
data/bin/sgt CHANGED
@@ -4,10 +4,20 @@
4
4
  # Sergeant (sgt) - Interactive TUI directory navigator
5
5
  # Version: 1.0.0
6
6
 
7
- # Add lib directory to load path for development
8
- $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
9
-
10
- require 'sergeant'
7
+ begin
8
+ require 'sergeant'
9
+ rescue LoadError => e
10
+ warn "Error loading sergeant: #{e.message}"
11
+ warn "Load path: #{$LOAD_PATH.join(', ')}"
12
+ warn "\nTry reinstalling: gem uninstall sergeant && gem install sergeant"
13
+ exit 1
14
+ end
11
15
 
12
16
  # Run the navigator
13
- SergeantApp.new.run
17
+ begin
18
+ SergeantApp.new.run
19
+ rescue StandardError => e
20
+ warn "\nSergeant error: #{e.message}"
21
+ warn e.backtrace.join("\n")
22
+ exit 1
23
+ end
@@ -54,6 +54,7 @@ module Sergeant
54
54
  noecho
55
55
  stdscr.keypad(true)
56
56
  apply_color_theme
57
+ refresh # Ensure display updates on all platforms
57
58
  end
58
59
 
59
60
  def preview_file
@@ -107,6 +108,7 @@ module Sergeant
107
108
  noecho
108
109
  stdscr.keypad(true)
109
110
  apply_color_theme
111
+ refresh # Ensure display updates on all platforms
110
112
  end
111
113
 
112
114
  def paste_with_modal
@@ -163,6 +165,9 @@ module Sergeant
163
165
  else
164
166
  show_info_modal("Successfully pasted #{success_count} item(s)")
165
167
  end
168
+
169
+ # Force refresh to show new files
170
+ force_refresh
166
171
  end
167
172
 
168
173
  def get_unique_filename(path)
@@ -208,6 +213,9 @@ module Sergeant
208
213
  else
209
214
  show_info_modal("Successfully deleted #{success_count} item(s)")
210
215
  end
216
+
217
+ # Force refresh to show changes
218
+ force_refresh
211
219
  end
212
220
 
213
221
  def rename_with_modal(item)
@@ -358,6 +366,9 @@ module Sergeant
358
366
  @copied_items.delete(old_path)
359
367
  @copied_items << new_path
360
368
  end
369
+
370
+ # Force refresh to show renamed item
371
+ force_refresh
361
372
  rescue StandardError => e
362
373
  show_error_modal("Error: #{e.message}")
363
374
  end
@@ -496,6 +507,9 @@ module Sergeant
496
507
  FileUtils.mkdir_p(new_path)
497
508
  show_info_modal('Directory created successfully!')
498
509
  end
510
+
511
+ # Force refresh to show new item
512
+ force_refresh
499
513
  rescue StandardError => e
500
514
  show_error_modal("Error: #{e.message}")
501
515
  end
@@ -629,6 +643,10 @@ module Sergeant
629
643
  noecho
630
644
  stdscr.keypad(true)
631
645
  apply_color_theme
646
+ refresh # Ensure display updates on all platforms
647
+
648
+ # Force refresh to show any changes from the command
649
+ force_refresh
632
650
  end
633
651
  end
634
652
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sergeant
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
data/lib/sergeant.rb CHANGED
@@ -43,9 +43,11 @@ class SergeantApp
43
43
  apply_color_theme
44
44
 
45
45
  begin
46
+ needs_refresh = true
46
47
  loop do
47
- refresh_items
48
+ refresh_items if needs_refresh
48
49
  draw_screen
50
+ needs_refresh = false
49
51
 
50
52
  key = getch
51
53
  case key
@@ -59,17 +61,22 @@ class SergeantApp
59
61
  @current_dir = item[:path]
60
62
  @selected_index = 0
61
63
  @scroll_offset = 0
64
+ needs_refresh = true
62
65
  elsif item && item[:type] == :file
63
66
  preview_file
67
+ needs_refresh = true
64
68
  end
65
69
  when 'b'
66
70
  goto_bookmark
71
+ needs_refresh = true
67
72
  when 'o'
68
73
  @show_ownership = !@show_ownership
69
74
  when 'e'
70
75
  edit_file
76
+ needs_refresh = true
71
77
  when 'v'
72
78
  preview_file
79
+ needs_refresh = true
73
80
  when 32, ' '
74
81
  toggle_mark
75
82
  when 'c'
@@ -78,20 +85,26 @@ class SergeantApp
78
85
  cut_marked_items
79
86
  when 'd'
80
87
  delete_marked_items
88
+ needs_refresh = true
81
89
  when 'r'
82
90
  rename_item
91
+ needs_refresh = true
83
92
  when 'p'
84
93
  paste_items
94
+ needs_refresh = true
85
95
  when 'u'
86
96
  unmark_all
87
97
  when 'm'
88
98
  show_help_modal
89
99
  when 'n'
90
100
  create_new_with_modal
101
+ needs_refresh = true
91
102
  when ':'
92
103
  execute_terminal_command
104
+ needs_refresh = true
93
105
  when '/'
94
106
  search_files
107
+ needs_refresh = true
95
108
  when 'q', 27
96
109
  close_screen
97
110
  puts @current_dir
@@ -102,6 +115,7 @@ class SergeantApp
102
115
  @current_dir = parent
103
116
  @selected_index = 0
104
117
  @scroll_offset = 0
118
+ needs_refresh = true
105
119
  end
106
120
  end
107
121
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sergeant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Grotha