VimMate 0.6.2 → 0.6.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.
data/CHANGELOG CHANGED
@@ -1,5 +1,15 @@
1
1
  = Changelog
2
2
 
3
+ === Version 0.6.3
4
+ - # 13212: VimMate could not be resized properly.
5
+ - # 7399, partially. A new warning has been added when too many files are
6
+ loaded by VimMate. The warning asks the user if he wants to continue. The
7
+ default number of files is 300 and can be changed by setting the option
8
+ :files_warn_too_many_files to an other number. The warning is popped every
9
+ multiple of this settings, which means at 300, 600, 900... This can be
10
+ changed by setting the option :files_warn_too_many_files_each_step to
11
+ false.
12
+
3
13
  === Version 0.6.2
4
14
  - # 7028: It's now possible to install VimMate using the provided setup.rb
5
15
  or with Ruby Gems.
data/README CHANGED
@@ -40,8 +40,8 @@ To install:
40
40
  Try running <tt>ruby --version</tt> in a terminal.
41
41
  - Install the Ruby bindings to GTK and GNOME (for the VTE terminal). See
42
42
  {Ruby-GNOME2 website}[http://ruby-gnome2.sourceforge.jp/]. Only
43
- Ruby-GNOME2 version 0.15 has been tested. You don't need VTE: if it's
44
- not installed, VimMate will not have terminals but will run anyway.
43
+ Ruby-GNOME2 version 0.15 and 0.16 has been tested. You don't need VTE: if
44
+ it's not installed, VimMate will not have terminals but will run anyway.
45
45
  - If you want to use the Subversion integration feature, you must install
46
46
  the subversion bindings for Ruby. Check if it's available for your OS
47
47
  or get the sources from
@@ -184,7 +184,8 @@ There are a lot of other nice script out there so check
184
184
 
185
185
  = Limitations
186
186
  - VimMate cannot handle well a directory tree with thousands of files,
187
- although it has no problems with hundreds of files.
187
+ although it has no problems with hundreds of files although it can take
188
+ some time to start.
188
189
  - Vim loads after VimMate is started. If you close VimMate or open a file
189
190
  before Vim starts and is connected to VimMate, this can lead to weird
190
191
  things. You should wait for Vim before you start playing with VimMate.
data/bin/vimmate CHANGED
@@ -109,12 +109,14 @@ fork do
109
109
 
110
110
  # When there are no files, add the current directory to the file list.
111
111
  # If files are specified on the command line, use them
112
- if ARGV.empty?
113
- files.add_path(File.expand_path('.'))
114
- files.expand_first_row
115
- else
116
- ARGV.each do |file|
117
- files.add_path(File.expand_path(file))
112
+ files.initial_add do
113
+ if ARGV.empty?
114
+ files.add_path(File.expand_path('.'))
115
+ files.expand_first_row
116
+ else
117
+ ARGV.each do |file|
118
+ files.add_path(File.expand_path(file))
119
+ end
118
120
  end
119
121
  end
120
122
 
@@ -50,6 +50,8 @@ module VimMate
50
50
  :files_use_search => true,
51
51
  :files_search_ignore_case => true,
52
52
  :files_search_separator_position => 400,
53
+ :files_warn_too_many_files => 300,
54
+ :files_warn_too_many_files_each_step => true,
53
55
  :terminals_enabled => true,
54
56
  :terminals_height => 50,
55
57
  :terminals_font => "10",
@@ -179,6 +179,9 @@ module VimMate
179
179
  @refresh_signal = Set.new
180
180
  @signal_method = method(:signal)
181
181
  @exclude_file_list = exclude_file_list
182
+ @too_many_files_signal = Set.new
183
+ @warn_too_many_files = false
184
+ @warn_files_count = 0
182
185
  end
183
186
 
184
187
  # Yield each files and directory at the root of the tree
@@ -200,6 +203,19 @@ module VimMate
200
203
  self
201
204
  end
202
205
 
206
+ # Indicates that the initial file adding is going on. Used to warn if
207
+ # there are too many files
208
+ def initial_add
209
+ begin
210
+ @warn_files_count = 0
211
+ @warn_too_many_files = true
212
+ yield
213
+ ensure
214
+ @warn_files_count = 0
215
+ @warn_too_many_files = false
216
+ end
217
+ end
218
+
203
219
  # Refresh the files from the tree. Inexistent files are removed and
204
220
  # new files are added
205
221
  def refresh
@@ -217,10 +233,29 @@ module VimMate
217
233
  @refresh_signal << block
218
234
  end
219
235
 
236
+ # Add a block that will be called when too many files are added.
237
+ # The block takes 1 argument, the number of files that where added.
238
+ def add_too_many_files_signal(&block)
239
+ @too_many_files_signal << block
240
+ end
241
+
220
242
  private
221
243
 
222
244
  # Signal that a file has been added or removed.
223
245
  def signal(method, file)
246
+ if @warn_too_many_files
247
+ @warn_files_count += 1
248
+ warn = if Config[:files_warn_too_many_files_each_step]
249
+ (@warn_files_count % Config[:files_warn_too_many_files]) == 0
250
+ else
251
+ @warn_files_count == Config[:files_warn_too_many_files]
252
+ end
253
+ if warn
254
+ @too_many_files_signal.each do |block|
255
+ block.call(@warn_files_count)
256
+ end
257
+ end
258
+ end
224
259
  @refresh_signal.each do |block|
225
260
  block.call(method, file)
226
261
  end
@@ -240,12 +240,7 @@ module VimMate
240
240
 
241
241
  gtk_window.border_width = 5
242
242
 
243
- # Launch a timer to refresh the file list
244
243
  @file_tree_mutex = Mutex.new
245
- Gtk.timeout_add(Config[:files_refresh_interval] * 1000) do
246
- do_refresh
247
- true
248
- end
249
244
  end
250
245
 
251
246
  # Recursively add a path at the root of the tree
@@ -311,6 +306,17 @@ module VimMate
311
306
  @expander_signal << block
312
307
  end
313
308
 
309
+ # Indicates that the initial file adding is going on. The timer to refresh
310
+ # the list is started after the initial add.
311
+ def initial_add(&block)
312
+ @file_tree.initial_add(&block)
313
+ # Launch a timer to refresh the file list
314
+ Gtk.timeout_add(Config[:files_refresh_interval] * 1000) do
315
+ do_refresh
316
+ true
317
+ end
318
+ end
319
+
314
320
  private
315
321
 
316
322
  # Lunch the refresh of the tree
@@ -324,6 +330,21 @@ module VimMate
324
330
  def initialize_file_tree(exclude_file_list)
325
331
  @file_tree = ListedTree.new(exclude_file_list)
326
332
 
333
+ @file_tree.add_too_many_files_signal do |nbfiles|
334
+ dialog = Gtk::MessageDialog.new(nil,
335
+ Gtk::MessageDialog::Flags::MODAL,
336
+ Gtk::MessageDialog::Type::QUESTION,
337
+ Gtk::MessageDialog::ButtonsType::YES_NO,
338
+ "A large number of files will be processed (more than #{nbfiles}). This could take a long time. Continue anyway ?")
339
+ dialog.set_icon_list(Icons.window_icons)
340
+ if dialog.run == Gtk::Dialog::RESPONSE_NO
341
+ puts "\n\nToo many files. The user chose to stop loading. Exiting now.\n\n"
342
+ exit
343
+ end
344
+ dialog.hide
345
+ dialog.destroy
346
+ end
347
+
327
348
  # Register to receive a signal when a file is added or removed
328
349
  @file_tree.add_refresh_signal do |method, file|
329
350
  case method
@@ -55,7 +55,7 @@ module VimMate
55
55
  @gtk_notebook.page = page_num
56
56
  end
57
57
  end
58
- @gtk_notebook.set_size_request(-1, Config[:terminals_height])
58
+ @gtk_notebook.set_size_request(0, Config[:terminals_height])
59
59
  end
60
60
 
61
61
  # The "window" for this object
@@ -24,6 +24,6 @@ SOFTWARE.
24
24
  module VimMate
25
25
 
26
26
  # VimMate's version
27
- VERSION = "0.6.2"
27
+ VERSION = "0.6.3"
28
28
  end
29
29
 
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: VimMate
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.2
7
- date: 2006-12-20 00:00:00 -05:00
6
+ version: 0.6.3
7
+ date: 2007-08-20 00:00:00 -04:00
8
8
  summary: VimMate is a graphical add-on to Vim with IDE-like features.
9
9
  require_paths:
10
10
  - lib
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
25
  platform: ruby
26
26
  signing_key:
27
27
  cert_chain:
28
+ post_install_message:
28
29
  authors:
29
30
  - Guillaume Benny
30
31
  files: