redcar 0.12.1 → 0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/CHANGES +18 -0
  2. data/bin/redcar +1 -0
  3. data/lib/redcar.rb +4 -5
  4. data/lib/redcar/usage.rb +0 -1
  5. data/lib/redcar_quick_start.rb +3 -1
  6. data/plugins/application/lib/application.rb +1 -0
  7. data/plugins/application/lib/application/commands/treebook_commands.rb +11 -18
  8. data/plugins/application/lib/application/dialog.rb +1 -1
  9. data/plugins/application/lib/application/dialogs/filter_list_dialog.rb +13 -5
  10. data/plugins/application/lib/application/global_state.rb +21 -0
  11. data/plugins/application/lib/application/menu/item.rb +37 -11
  12. data/plugins/application/lib/application/notebook.rb +12 -0
  13. data/plugins/application/lib/application/tree/mirror.rb +0 -11
  14. data/plugins/application/lib/application/window.rb +32 -7
  15. data/plugins/application_swt/lib/application_swt.rb +1 -1
  16. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +35 -10
  17. data/plugins/application_swt/lib/application_swt/icon.rb +1 -1
  18. data/plugins/application_swt/lib/application_swt/menu.rb +47 -15
  19. data/plugins/application_swt/lib/application_swt/notebook.rb +11 -2
  20. data/plugins/application_swt/lib/application_swt/window.rb +37 -34
  21. data/plugins/auto_indenter/lib/auto_indenter/analyzer.rb +1 -1
  22. data/plugins/auto_indenter/spec/auto_indenter/analyzer_spec.rb +9 -0
  23. data/plugins/declarations/lib/declarations.rb +31 -66
  24. data/plugins/declarations/lib/declarations/commands.rb +142 -0
  25. data/plugins/declarations/lib/declarations/file.rb +1 -1
  26. data/plugins/{outline_view → declarations}/spec/fixtures/some_project/javascript.js +0 -0
  27. data/plugins/{outline_view → declarations}/spec/fixtures/some_project/nothing_to_see.rb +0 -0
  28. data/plugins/{outline_view → declarations}/spec/fixtures/some_project/one_lonely_class.rb +0 -0
  29. data/plugins/{outline_view → declarations}/spec/fixtures/some_project/similar_names.rb +0 -0
  30. data/plugins/{outline_view → declarations}/spec/fixtures/some_project/something_fancy.rb +0 -0
  31. data/plugins/{outline_view → declarations}/spec/fixtures/some_project/trailing_space.rb +0 -0
  32. data/plugins/edit_view/lib/edit_view.rb +35 -2
  33. data/plugins/edit_view/lib/edit_view/commands/change_language_command.rb +31 -0
  34. data/plugins/edit_view/lib/edit_view/commands/language_settings_commands.rb +45 -0
  35. data/plugins/edit_view/lib/edit_view/document/command.rb +1 -1
  36. data/plugins/edit_view/lib/edit_view/edit_tab.rb +11 -13
  37. data/plugins/key_bindings/lib/key_bindings.rb +6 -2
  38. data/plugins/project/lib/project.rb +27 -32
  39. data/plugins/project/lib/project/commands.rb +3 -88
  40. data/plugins/project/lib/project/dir_controller.rb +12 -18
  41. data/plugins/project/lib/project/dir_mirror.rb +20 -25
  42. data/plugins/project/lib/project/file_mirror.rb +10 -10
  43. data/plugins/project/lib/project/find_file_dialog.rb +20 -18
  44. data/plugins/project/lib/project/find_recent_dialog.rb +6 -3
  45. data/plugins/project/lib/project/{adapters/local.rb → local_filesystem.rb} +35 -35
  46. data/plugins/project/lib/project/manager.rb +21 -75
  47. data/plugins/project/lib/project/sub_project.rb +3 -3
  48. data/plugins/project/plugin.rb +0 -1
  49. data/plugins/project_search/lib/project_search/lucene_refresh.rb +0 -1
  50. data/plugins/redcar/plugin.rb +2 -2
  51. data/plugins/redcar/redcar.rb +34 -42
  52. data/plugins/ruby/lib/ruby/syntax_checker.rb +27 -7
  53. data/plugins/scm/lib/scm.rb +1 -12
  54. data/plugins/sessions/lib/sessions.rb +22 -0
  55. data/plugins/sessions/lib/sessions/cursor_saver.rb +162 -0
  56. data/plugins/sessions/lib/sessions/loader.rb +99 -0
  57. data/plugins/sessions/lib/sessions/memory.rb +59 -0
  58. data/plugins/sessions/plugin.rb +8 -0
  59. data/plugins/strip_trailing_spaces/lib/strip_trailing_spaces.rb +2 -2
  60. data/plugins/syntax_check/lib/syntax_check.rb +2 -2
  61. data/plugins/tree_view_swt/lib/tree_view_swt.rb +1 -3
  62. data/redcar.gemspec +1 -1
  63. metadata +195 -291
  64. data/plugins/connection_manager/lib/connection_manager.rb +0 -57
  65. data/plugins/connection_manager/lib/connection_manager/commands.rb +0 -14
  66. data/plugins/connection_manager/lib/connection_manager/connection_store.rb +0 -87
  67. data/plugins/connection_manager/lib/connection_manager/controller.rb +0 -100
  68. data/plugins/connection_manager/lib/connection_manager/filter_dialog.rb +0 -38
  69. data/plugins/connection_manager/lib/connection_manager/private_key_store.rb +0 -93
  70. data/plugins/connection_manager/plugin.rb +0 -12
  71. data/plugins/connection_manager/views/index.html.erb +0 -284
  72. data/plugins/edit_view/lib/edit_view/info_speedbar.rb +0 -98
  73. data/plugins/outline_view/features/outline_view.feature +0 -79
  74. data/plugins/outline_view/features/project_outline.feature +0 -23
  75. data/plugins/outline_view/features/step_definitions/outline_steps.rb +0 -61
  76. data/plugins/outline_view/lib/outline_view.rb +0 -97
  77. data/plugins/outline_view/lib/outline_view/commands.rb +0 -19
  78. data/plugins/outline_view/plugin.rb +0 -10
  79. data/plugins/outline_view_swt/lib/outline_view_swt.rb +0 -79
  80. data/plugins/outline_view_swt/plugin.rb +0 -7
  81. data/plugins/project/lib/project/adapters/remote.rb +0 -96
  82. data/plugins/project/lib/project/adapters/remote_protocols/ftp.rb +0 -93
  83. data/plugins/project/lib/project/adapters/remote_protocols/protocol.rb +0 -94
  84. data/plugins/project/lib/project/adapters/remote_protocols/sftp.rb +0 -181
@@ -4,11 +4,14 @@ module Redcar
4
4
  class FindRecentDialog < FilterListDialog
5
5
  def update_list(filter)
6
6
  recent = Project::Recent.storage['list']
7
- recent = recent.map {|path| path.gsub(/^#{Regexp.escape(Redcar.home_dir)}\/?/, "")}
8
- filter_and_rank_by(recent, filter)
7
+ recent = recent.map do |path|
8
+ {:name => path.gsub(/^#{Regexp.escape(Redcar.home_dir)}\/?/, ""), :icon => :dir}
9
+ end
10
+ filter_and_rank_by(recent, filter) {|h| h[:name] }
9
11
  end
10
12
 
11
- def selected(path, ix)
13
+ def selected(item, ix)
14
+ path = item[:name]
12
15
  unless path[0..0] == "/" or path =~ /^[A-Z]:\//
13
16
  path = Redcar.home_dir + "/" + path
14
17
  end
@@ -1,36 +1,40 @@
1
1
  module Redcar
2
2
  class Project
3
- module Adapters
4
- class Local
5
- def touch(new_file_path)
3
+ module LocalFilesystem
4
+ def fs
5
+ Methods
6
+ end
7
+
8
+ class Methods
9
+ def self.touch(new_file_path)
6
10
  FileUtils.touch(new_file_path)
7
11
  end
8
-
9
- def mkdir(new_dir_path)
12
+
13
+ def self.mkdir(new_dir_path)
10
14
  FileUtils.mkdir(new_dir_path)
11
15
  end
12
-
13
- def mv(path, new_path)
16
+
17
+ def self.mv(path, new_path)
14
18
  FileUtils.mv(path, new_path)
15
19
  new_path = File.join(new_path, File.basename(path)) unless File.file?(new_path)
16
20
  Manager.update_tab_for_path(path,new_path)
17
21
  end
18
-
19
- def file?(path)
22
+
23
+ def self.file?(path)
20
24
  File.file?(path)
21
25
  end
22
-
23
- def directory?(path)
26
+
27
+ def self.directory?(path)
24
28
  # JRuby's File.directory? seems to have a problem with multi-byte strings
25
29
  f = java.io.File.new(path.to_java)
26
30
  f.directory?
27
31
  end
28
-
29
- def empty_directory?(path)
32
+
33
+ def self.empty_directory?(path)
30
34
  Dir.glob("#{path}/*", File::FNM_DOTMATCH).length <= 2
31
35
  end
32
-
33
- def fetch_contents(path, force=false)
36
+
37
+ def self.fetch_contents(path, force=false)
34
38
  Dir.glob("#{path}/*", File::FNM_DOTMATCH).map do |fn|
35
39
  is_dir = directory?(fn)
36
40
  hash = {
@@ -43,40 +47,36 @@ module Redcar
43
47
  hash
44
48
  end
45
49
  end
46
-
47
- def load(file)
48
- File.open(file, 'rb') do |f|; f.read; end
50
+
51
+ def self.load(file)
52
+ File.read(file)
49
53
  end
50
-
51
- def save(file, contents)
54
+
55
+ def self.save(file, contents)
52
56
  File.open(file, "wb") {|f| f.print contents }
53
57
  end
54
-
55
- def mtime(file)
58
+
59
+ def self.mtime(file)
56
60
  File.mtime(file)
57
61
  end
58
-
59
- def exists?(file)
62
+
63
+ def self.exists?(file)
60
64
  File.exists?(file)
61
65
  end
62
-
63
- def delete(file)
66
+
67
+ def self.delete(file)
64
68
  FileUtils.rm_rf(file) unless Trash.recycle(file)
65
69
  Manager.update_tab_for_path(file)
66
70
  end
67
-
68
- def load_contents(file)
71
+
72
+ def self.load_contents(file)
69
73
  File.open(file, 'rb') do |f|; f.read; end
70
74
  end
71
-
72
- def save_contents(file)
75
+
76
+ def self.save_contents(file)
73
77
  File.open(file, "wb") {|f| f.print contents }
74
78
  end
75
-
76
- def refresh_operation(tree)
77
- yield
78
- end
79
79
  end
80
80
  end
81
81
  end
82
- end
82
+ end
@@ -3,58 +3,12 @@ module Redcar
3
3
  class Project
4
4
  class Manager
5
5
 
6
- def self.connect_to_remote(protocol, host, user, path, private_key_files = [])
7
- if protocol == "SFTP" and private_key_files.any?
8
- begin
9
- adapter = open_adapter(protocol, host, user, nil, private_key_files)
10
- open_remote_project(adapter, path)
11
- rescue Net::SSH::AuthenticationFailed
12
- if pw = get_password
13
- adapter = open_adapter(protocol, host, user, pw, [])
14
- open_remote_project(adapter, path)
15
- end
16
- end
17
- else
18
- if pw = get_password
19
- adapter = open_adapter(protocol, host, user, pw, [])
20
- open_remote_project(adapter, path)
21
- end
22
- end
23
- rescue => e
24
- puts "Error connecting: #{e.class}: #{e.message}"
25
- puts e.backtrace
26
- Application::Dialog.message_box("Error connecting: #{e.message}", :type => :error)
27
- end
28
-
29
- def self.get_password
30
- result = Redcar::Application::Dialog.password_input("Remote Connection", "Enter password")
31
- result[:value] if result
32
- end
33
-
34
- # Opens a new Tree with a DirMirror and DirController for the given
35
- # path, in a new window.
36
- #
37
- # @param [String] path the path of the directory to view
38
- def self.open_remote_project(adapter, path)
39
- win = Redcar.app.focussed_window
40
- win = Redcar.app.new_window if !win or Manager.in_window(win)
41
- project = Project.new(path, adapter)
42
- project.open(win) if project.ready?
43
- end
44
-
45
- def self.open_adapter(protocol, host, user, password, private_key_files)
46
- Adapters::Remote.new(protocol.downcase.to_sym, host, user, password, private_key_files)
47
- rescue Errno::ECONNREFUSED
48
- raise "connection refused connecting to #{host}"
49
- rescue SocketError
50
- raise "Cannot connect to #{host}. Error: #{$!.message}."
51
- end
52
-
53
6
  def self.open_projects
54
7
  Project.window_projects.values
55
8
  end
56
9
 
57
10
  # Returns the project in the given window
11
+ #
58
12
  # @param [Window] window
59
13
  # @return Project or nil
60
14
  def self.in_window(window)
@@ -65,14 +19,8 @@ module Redcar
65
19
  Redcar.app.windows.reject {|w| in_window(w) }
66
20
  end
67
21
 
68
- # this will restore open files unless other files or dirs were passed
69
- # as command line parameters
70
22
  def self.start(args)
71
- unless handle_startup_arguments(args)
72
- unless Redcar.environment == :test
73
- #restore_last_session
74
- end
75
- end
23
+ handle_startup_arguments(args)
76
24
  init_current_files_hooks
77
25
  init_window_closed_hooks
78
26
  init_drb_listener
@@ -163,13 +111,14 @@ module Redcar
163
111
  #
164
112
  # @path [String] path the path of the file to be edited
165
113
  # @param [Window] win the Window to open the File in
166
- def self.open_file_in_window(path, win, adapter)
114
+ def self.open_file_in_window(path, win)
167
115
  return unless large_file_airbag(path)
168
116
  tab = win.new_tab(Redcar::EditTab)
169
- mirror = FileMirror.new(path, adapter)
117
+ mirror = FileMirror.new(path)
170
118
  tab.edit_view.document.mirror = mirror
171
119
  tab.edit_view.reset_undo
172
120
  tab.focus
121
+ tab
173
122
  end
174
123
 
175
124
  def self.file_too_large?(path)
@@ -194,10 +143,10 @@ module Redcar
194
143
  }.sort_by {|p| path.split(//).length-p.path.split(//).length}
195
144
  end
196
145
 
197
- def self.open_file(path, adapter=Adapters::Local.new)
146
+ def self.open_file(path)
198
147
  if tab = find_open_file_tab(path)
199
148
  tab.focus
200
- return
149
+ return tab
201
150
  end
202
151
  if project = find_projects_containing_path(path).first
203
152
  window = project.window
@@ -205,8 +154,9 @@ module Redcar
205
154
  window = windows_without_projects.first || Redcar.app.new_window
206
155
  Project::Recent.store_path(path)
207
156
  end
208
- open_file_in_window(path, window, adapter)
157
+ tab = open_file_in_window(path, window)
209
158
  window.focus
159
+ tab
210
160
  end
211
161
 
212
162
  def self.pop_first_line_option(args)
@@ -266,6 +216,7 @@ module Redcar
266
216
  win = Redcar.app.focussed_window
267
217
  win = Redcar.app.new_window(false) if !win or Manager.in_window(win)
268
218
  project.open(win) if project.ready?
219
+ p project
269
220
  Redcar.app.show_window(win)
270
221
  project
271
222
  end
@@ -373,20 +324,6 @@ module Redcar
373
324
  end
374
325
  end
375
326
 
376
- # restores the directory/files in the last open window
377
- def self.restore_last_session
378
- if path = storage['last_open_dir']
379
- s = Time.now
380
- open_project_for_path(path)
381
- end
382
-
383
- if files = storage['files_open_last_session']
384
- files.each do |path|
385
- open_file(path)
386
- end
387
- end
388
- end
389
-
390
327
  def self.refresh_modified_file(path)
391
328
  path = File.expand_path(path)
392
329
  find_projects_containing_path(path).each do |project|
@@ -414,11 +351,20 @@ module Redcar
414
351
  item "Find File", Project::FindFileCommand
415
352
  # item "Refresh Directory", Project::RefreshDirectoryCommand
416
353
  end
417
- item "Reveal Open File in Tree", :command => Project::ToggleRevealInProject, :type => :check, :active => Project::Manager.reveal_files?
354
+ item "Reveal Open File in Tree", :command => Project::ToggleRevealInProject, :type => :check, :checked => lambda { Project::Manager.reveal_files? }
418
355
  end
419
356
  end
420
357
  end
421
358
 
359
+ def self.tab_context_menu(tab)
360
+ Menu::Builder.build do
361
+ if tab.is_a?(EditTab)
362
+ path = tab.edit_view.document.path
363
+ item("Copy path to clipboard", :enabled => !!path) { Redcar.app.clipboard << path if path }
364
+ end
365
+ end
366
+ end
367
+
422
368
  # Uses our own context menu hook to provide context menu entries
423
369
  # @return [Menu]
424
370
  def self.project_context_menus(tree, node, controller)
@@ -452,7 +398,7 @@ module Redcar
452
398
  separator
453
399
  if tree.selection.length > 1
454
400
  dirs = tree.selection.map {|node| node.parent_dir }
455
- if dirs.uniq.length == 1 and node.adapter.is_a?(Adapters::Local)
401
+ if dirs.uniq.length == 1
456
402
  item("Bulk Rename") { controller.rename(tree, node) }
457
403
  end
458
404
  else
@@ -3,9 +3,9 @@ module Redcar
3
3
  class Project
4
4
  class SubProject < Project
5
5
 
6
- def initialize(project_path, path, adapter=Adapters::Local.new)
7
- super(path,adapter)
8
- @project=project_path
6
+ def initialize(project_path, path)
7
+ super(path)
8
+ @project = project_path
9
9
  end
10
10
 
11
11
  def config_files(glob)
@@ -6,6 +6,5 @@ Plugin.define do
6
6
  object "Redcar::Project::Manager"
7
7
  dependencies "edit_view", ">0",
8
8
  "HTML View", ">0",
9
- "connection_manager", ">0",
10
9
  "application", ">=1.1"
11
10
  end
@@ -11,7 +11,6 @@ class ProjectSearch
11
11
  end
12
12
 
13
13
  def execute
14
- return if @project.remote?
15
14
  unless index = ProjectSearch.indexes[@project.path]
16
15
  index = ProjectSearch::LuceneIndex.new(@project)
17
16
  ProjectSearch.indexes[@project.path] = index
@@ -11,7 +11,7 @@ Plugin.define do
11
11
  "auto_indenter", ">0",
12
12
  "document_search", ">0",
13
13
  "runnables", ">0",
14
+ "sessions", ">0",
14
15
  "HTML View", ">=0.3.2",
15
- "Plugin Manager UI", ">=0.3.2",
16
- "outline_view", ">0"
16
+ "Plugin Manager UI", ">=0.3.2"
17
17
  end
@@ -41,61 +41,61 @@ module Redcar
41
41
  end
42
42
  end
43
43
 
44
- class GenerateWindowsMenu < Command
45
- def initialize(builder)
46
- @builder = builder
47
- end
48
-
49
- def execute
44
+ class GenerateWindowsMenu
45
+ def self.on(builder)
50
46
  window = Redcar.app.focussed_window
51
47
  Redcar.app.windows.each do |win|
52
- @builder.item(win.title, :type => :radio, :active => (win == window)) do
48
+ builder.item(win.title, :type => :radio, :checked => (win == window)) do
53
49
  Application::FocusWindowCommand.new(win).run
54
50
  end
55
51
  end
56
52
  end
57
53
  end
58
54
 
59
- class GenerateTabsMenu < Command
60
- def initialize(builder)
61
- @builder = builder
62
- end
63
-
64
- def trim(title)
55
+ class GenerateTabsMenu
56
+ def self.trim(title)
65
57
  title = title[0,13]+'...' if title.length > 13
66
58
  title
67
59
  end
68
60
 
69
- def execute
61
+ def self.on(builder)
70
62
  if win = Redcar.app.focussed_window and
71
63
  book = win.focussed_notebook and book.tabs.any?
72
64
  focussed_tab = book.focussed_tab
73
- @builder.separator
74
- @builder.item "Focussed Notebook", ShowTitle
65
+ builder.separator
66
+ builder.item "Focussed Notebook", ShowTitle
75
67
  book.tabs.each_with_index do |tab,i|
76
68
  num = i + 1
77
69
  if num < 10
78
70
  @builder.item("Tab #{num}: #{trim(tab.title)}",
79
71
  :type => :radio,
80
- :active => (tab == focussed_tab),
72
+ :checked => (tab == focussed_tab),
81
73
  :command => Redcar::Application.const_get("SelectTab#{num}Command")
82
74
  )
83
75
  else
84
76
  @builder.item("Tab #{num}: #{trim(tab.title)}",
85
- :type => :radio,
86
- :active => (tab == focussed_tab)) { tab.focus }
77
+ :type => :radio,
78
+ :checked => (tab == focussed_tab)) { tab.focus }
87
79
  end
88
80
  end
89
81
  if book = win.nonfocussed_notebook and book.tabs.any?
90
- @builder.separator
91
- @builder.item "Nonfocussed Notebook", ShowTitle
82
+ builder.separator
83
+ builder.item "Nonfocussed Notebook", ShowTitle
92
84
  book.tabs.each_with_index do |tab,i|
93
- @builder.item("Tab #{i+1}: #{trim(tab.title)}") {tab.focus}
85
+ builder.item("Tab #{i+1}: #{trim(tab.title)}") {tab.focus}
94
86
  end
95
87
  end
96
88
  end
97
89
  end
98
90
  end
91
+
92
+ class GenerateGrammarsMenu
93
+ def self.on(builder)
94
+ builder.item "Ruby", AboutCommand
95
+ builder.item "Java", AboutCommand
96
+ builder.item "Python", AboutCommand
97
+ end
98
+ end
99
99
 
100
100
  class AboutCommand < Command
101
101
  def execute
@@ -635,7 +635,6 @@ Redcar.environment: #{Redcar.environment}
635
635
 
636
636
  #link "Cmd+Return", MoveNextLineCommand
637
637
 
638
- link "Ctrl+Shift+E", EditView::InfoSpeedbarCommand
639
638
  link "Cmd+Z", UndoCommand
640
639
  link "Cmd+Shift+Z", RedoCommand
641
640
  link "Cmd+X", CutCommand
@@ -679,6 +678,7 @@ Redcar.environment: #{Redcar.environment}
679
678
  link "Ctrl+G", EditView::OppositeCaseTextCommand
680
679
  link "Ctrl+_", EditView::CamelSnakePascalRotateTextCommand
681
680
  link "Ctrl+=", EditView::AlignAssignmentCommand
681
+ link "Cmd+Alt+Ctrl+L", EditView::ChangeLanguageCommand
682
682
  link "Ctrl+Shift+^", SortLinesCommand
683
683
 
684
684
  link "Cmd+T", Project::FindFileCommand
@@ -734,7 +734,6 @@ Redcar.environment: #{Redcar.environment}
734
734
 
735
735
  link "Ctrl+Enter", MoveNextLineCommand
736
736
 
737
- link "Ctrl+Shift+E", EditView::InfoSpeedbarCommand
738
737
  link "Ctrl+Z", UndoCommand
739
738
  link "Ctrl+Y", RedoCommand
740
739
  link "Ctrl+X", CutCommand
@@ -772,6 +771,7 @@ Redcar.environment: #{Redcar.environment}
772
771
  link "Ctrl+Alt+Shift+U", EditView::OppositeCaseTextCommand
773
772
  link "Ctrl+_", EditView::CamelSnakePascalRotateTextCommand
774
773
  link "Ctrl+=", EditView::AlignAssignmentCommand
774
+ link "Ctrl+Alt+Shift+L", EditView::ChangeLanguageCommand
775
775
  link "Ctrl+Shift+^", SortLinesCommand
776
776
 
777
777
  link "Ctrl+T", Project::FindFileCommand
@@ -853,16 +853,12 @@ Redcar.environment: #{Redcar.environment}
853
853
 
854
854
  sub_menu "Edit", :priority => 5 do
855
855
  group(:priority => :first) do
856
- item "Tab Info", EditView::InfoSpeedbarCommand
857
- end
858
- group(:priority => 10) do
859
- separator
860
856
  item "Undo", UndoCommand
861
857
  item "Redo", RedoCommand
858
+ separator
862
859
  end
863
860
 
864
861
  group(:priority => 15) do
865
- separator
866
862
  item "Cut", CutCommand
867
863
  item "Copy", CopyCommand
868
864
  item "Paste", PasteCommand
@@ -870,19 +866,17 @@ Redcar.environment: #{Redcar.environment}
870
866
  item "Duplicate Region", DuplicateCommand
871
867
  item "Sort Lines in Region", SortLinesCommand
872
868
  end
869
+ separator
873
870
  end
874
871
 
875
872
  group(:priority => 30) do
876
- separator
877
873
  sub_menu "Selection" do
878
874
  item "All", SelectAllCommand
879
875
  item "Line", SelectLineCommand
880
876
  item "Current Word", SelectWordCommand
881
877
  item "Toggle Block Selection", ToggleBlockSelectionCommand
882
878
  end
883
- end
884
-
885
- group(:priority => 40) do
879
+
886
880
  sub_menu "Document Navigation" do
887
881
  item "Goto Line", GotoLineCommand
888
882
  item "Top", MoveTopCommand
@@ -909,9 +903,7 @@ Redcar.environment: #{Redcar.environment}
909
903
  item "Backward Navigation", BackwardNavigationCommand
910
904
  item "Forward Navigation", ForwardNavigationCommand
911
905
  end
912
- end
913
-
914
- group(:priority => 50) do
906
+
915
907
  sub_menu "Formatting" do
916
908
  item "Increase Indent", IncreaseIndentCommand
917
909
  item "Decrease Indent", DecreaseIndentCommand
@@ -938,7 +930,7 @@ Redcar.environment: #{Redcar.environment}
938
930
  end
939
931
  group(:priority => 10) do
940
932
  separator
941
- item "Toggle Fullscreen", :command => Application::ToggleFullscreen, :type => :check, :active => window ? window.fullscreen : false
933
+ item "Toggle Fullscreen", :command => Application::ToggleFullscreen, :type => :check, :checked => window ? window.fullscreen : false
942
934
  end
943
935
  group(:priority => 15) do
944
936
  separator
@@ -952,7 +944,7 @@ Redcar.environment: #{Redcar.environment}
952
944
  item "Next Tree", Application::SwitchTreeDownCommand
953
945
  end
954
946
  lazy_sub_menu "Windows" do
955
- GenerateWindowsMenu.new(self).run
947
+ GenerateWindowsMenu.on(self)
956
948
  end
957
949
  sub_menu "Notebooks" do
958
950
  item "New Notebook", Application::OpenNewNotebookCommand
@@ -979,9 +971,9 @@ Redcar.environment: #{Redcar.environment}
979
971
  end
980
972
  group(:priority => :last) do
981
973
  separator
982
- item "Show Toolbar", :command => Application::ToggleToolbar, :type => :check, :active => Redcar.app.show_toolbar?
983
- item "Show Invisibles", :command => ToggleInvisibles, :type => :check, :active => EditView.show_invisibles?
984
- item "Show Line Numbers", :command => ToggleLineNumbers, :type => :check, :active => EditView.show_line_numbers?
974
+ item "Show Toolbar", :command => Application::ToggleToolbar, :type => :check, :checked => lambda { Redcar.app.show_toolbar? }
975
+ item "Show Invisibles", :command => ToggleInvisibles, :type => :check, :checked => lambda { EditView.show_invisibles? }
976
+ item "Show Line Numbers", :command => ToggleLineNumbers, :type => :check, :checked => lambda { EditView.show_line_numbers? }
985
977
  end
986
978
  end
987
979
  sub_menu "Bundles", :priority => 45 do
@@ -1002,7 +994,7 @@ Redcar.environment: #{Redcar.environment}
1002
994
  separator
1003
995
  item "Check for Updates", :command => Application::ToggleCheckForUpdatesCommand,
1004
996
  :type => :check,
1005
- :active => Application::Updates.check_for_updates?
997
+ :checked => lambda { Application::Updates.check_for_updates? }
1006
998
  item "Update Available", Application::OpenUpdateCommand
1007
999
  end
1008
1000
  end