redcar 0.11.0dev → 0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +14 -1
- data/README.md +28 -8
- data/Rakefile +23 -18
- data/bin/redcar +9 -4
- data/lib/redcar.rb +42 -4
- data/lib/redcar/installer.rb +7 -2
- data/lib/redcar/logger.rb +64 -0
- data/lib/redcar/runner.rb +17 -8
- data/lib/redcar/usage.rb +2 -0
- data/plugins/application/features/step_definitions/tree_steps.rb +4 -4
- data/plugins/application/features/support/env.rb +6 -6
- data/plugins/application/lib/application.rb +31 -3
- data/plugins/application/lib/application/command.rb +6 -0
- data/plugins/application/lib/application/command/executor.rb +0 -1
- data/plugins/application/lib/application/commands/application_commands.rb +21 -0
- data/plugins/application/lib/application/commands/notebook_commands.rb +73 -0
- data/plugins/application/lib/application/commands/tab_commands.rb +105 -0
- data/plugins/application/lib/application/commands/treebook_commands.rb +117 -0
- data/plugins/application/lib/application/commands/window_commands.rb +68 -0
- data/plugins/{tree/lib → application/lib/application}/tree.rb +0 -4
- data/plugins/{tree/lib → application/lib/application}/tree/command.rb +0 -0
- data/plugins/{tree/lib → application/lib/application}/tree/controller.rb +0 -0
- data/plugins/{tree/lib → application/lib/application}/tree/mirror.rb +0 -0
- data/plugins/application/spec/application/keymap/builder_spec.rb +1 -1
- data/plugins/application/spec/application/menu/builder_spec.rb +2 -2
- data/plugins/application_swt/lib/application_swt.rb +4 -2
- data/plugins/application_swt/lib/swt/vtab_label.rb +6 -3
- data/plugins/auto_indenter/lib/auto_indenter/document_controller.rb +6 -3
- data/plugins/clojure/lib/clojure.rb +2 -2
- data/plugins/core/lib/core.rb +0 -4
- data/plugins/core/lib/core/gui.rb +2 -4
- data/plugins/core/lib/core/plugin/storage.rb +68 -21
- data/plugins/core/spec/core/base_storage_spec.rb +81 -0
- data/plugins/core/spec/core/shared_storage_spec.rb +49 -0
- data/plugins/core/spec/core/storage_spec.rb +13 -63
- data/plugins/declarations/lib/declarations.rb +3 -1
- data/plugins/document_search/features/replace.feature +29 -20
- data/plugins/document_search/lib/document_search/find_speedbar.rb +4 -1
- data/plugins/edit_view/features/indentation_commands.feature +6 -5
- data/plugins/edit_view/features/step_definitions/notebook_steps.rb +4 -4
- data/plugins/edit_view/features/step_definitions/tab_steps.rb +7 -7
- data/plugins/edit_view/features/step_definitions/window_steps.rb +2 -2
- data/plugins/edit_view/lib/edit_view.rb +15 -1
- data/plugins/edit_view/lib/edit_view/modified_tabs_checker.rb +7 -7
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +7 -6
- data/plugins/execute_current_tab/lib/execute_current_tab.rb +1 -1
- data/plugins/groovy/lib/groovy.rb +3 -3
- data/plugins/groovy/lib/groovy/commands.rb +1 -1
- data/plugins/help/lib/help/view_controller.rb +5 -0
- data/plugins/help/views/index.html.erb +10 -1
- data/plugins/html_view/features/step_definitions/html_view_steps.rb +1 -1
- data/plugins/html_view/features/support/env.rb +0 -15
- data/plugins/html_view/lib/html_view.rb +3 -4
- data/plugins/html_view/lib/html_view/commands.rb +1 -1
- data/plugins/key_bindings/lib/key_bindings.rb +34 -0
- data/plugins/key_bindings/plugin.rb +8 -0
- data/plugins/{tree → key_bindings}/spec/spec_helper.rb +0 -0
- data/plugins/line_tools/features/lower_text.feature +3 -4
- data/plugins/line_tools/lib/line_tools.rb +6 -5
- data/plugins/mirah/lib/mirah.rb +2 -2
- data/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb +5 -3
- data/plugins/project/features/open_directory_tree.feature +1 -1
- data/plugins/project/features/step_definitions/file_steps.rb +5 -5
- data/plugins/project/features/step_definitions/find_file_steps.rb +2 -3
- data/plugins/project/features/support/env.rb +4 -0
- data/plugins/project/lib/project.rb +15 -9
- data/plugins/project/lib/project/commands.rb +46 -16
- data/plugins/project/lib/project/dir_controller.rb +1 -1
- data/plugins/project/lib/project/dir_mirror.rb +3 -2
- data/plugins/project/lib/project/drb_service.rb +3 -1
- data/plugins/project/lib/project/file_list.rb +99 -21
- data/plugins/project/lib/project/find_file_dialog.rb +8 -24
- data/plugins/project/lib/project/manager.rb +68 -12
- data/plugins/project/lib/project/project_tree_controller.rb +1 -1
- data/plugins/project/plugin.rb +1 -2
- data/plugins/project_search/features/word_search.feature +1 -1
- data/plugins/project_search/lib/project_search.rb +16 -6
- data/plugins/project_search/lib/project_search/commands.rb +15 -28
- data/plugins/project_search/lib/project_search/hit.rb +4 -0
- data/plugins/project_search/lib/project_search/lucene_index.rb +14 -4
- data/plugins/project_search/lib/project_search/views/_file.html.erb +11 -11
- data/plugins/project_search/lib/project_search/word_search.rb +22 -4
- data/plugins/project_search/spec/project_search/word_search_spec.rb +2 -2
- data/plugins/redcar/redcar.rb +140 -588
- data/plugins/repl/features/step_definitions/repl_steps.rb +3 -3
- data/plugins/repl/features/support/fake_repl.rb +1 -1
- data/plugins/ruby/lib/ruby.rb +4 -4
- data/plugins/runnables/features/fixtures/alternate.ruby +1 -0
- data/plugins/runnables/features/fixtures/line_app.rb +1 -0
- data/plugins/runnables/features/fixtures/name_app.rb +1 -0
- data/plugins/runnables/features/fixtures/params_app.rb +1 -0
- data/plugins/runnables/features/fixtures/runnable_app.rb +1 -0
- data/plugins/runnables/lib/runnables.rb +21 -0
- data/plugins/runnables/lib/runnables/command_output_controller.rb +14 -9
- data/plugins/runnables/lib/runnables/output_processor.rb +4 -4
- data/plugins/runnables/lib/runnables/running_process_checker.rb +6 -6
- data/plugins/runnables/plugin.rb +1 -2
- data/plugins/scm/lib/scm.rb +18 -18
- data/plugins/scm/lib/scm/commit_mirror.rb +2 -2
- data/plugins/scm/lib/scm/scm_changes_controller.rb +1 -1
- data/plugins/scm_hg/lib/scm_hg.rb +1 -1
- data/plugins/snippets/lib/snippets/document_controller.rb +46 -40
- data/plugins/swt/lib/swt.rb +2 -0
- data/plugins/test_runner/lib/test_runner.rb +1 -0
- data/plugins/test_runner/lib/test_runner/jasmine_test_runner.rb +15 -0
- data/plugins/test_runner/lib/test_runner/runnable_test_runner.rb +21 -5
- data/plugins/textmate/lib/textmate.rb +5 -1
- data/plugins/textmate/lib/textmate/preference.rb +4 -0
- data/plugins/textmate/lib/textmate/snippet.rb +0 -2
- data/plugins/textmate/lib/textmate/tree_mirror.rb +6 -5
- data/plugins/textmate/plugin.rb +1 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/C.tmbundle/Syntaxes/C.plist +2 -2
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Clojure.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Plain_Text_Feature.tmLanguage +0 -4
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Cucumber.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Mirah.tmbundle/info.plist +3 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Palm-WebOS-Development.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/SQL.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Scala.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/Preferences/GNU_Smalltalk.tmPreferences +1 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/Preferences/MIST_Smalltalk_Format.tmPreferences +1 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Vala.tmbundle/info.plist +4 -2
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Webrat.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/YAML.tmbundle/Syntaxes/YAML.plist +1 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/groovy.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Themes/Twilight.tmTheme +0 -2
- data/plugins/todo_list/lib/todo_list.rb +3 -3
- data/plugins/todo_list/lib/todo_list/todo_controller.rb +1 -1
- data/plugins/web_bookmarks/features/step_definitions/web_steps.rb +1 -1
- data/plugins/web_bookmarks/lib/web_bookmarks.rb +11 -4
- data/plugins/web_bookmarks/lib/web_bookmarks/commands.rb +1 -1
- data/plugins/web_bookmarks/plugin.rb +1 -2
- metadata +29 -20
- data/plugins/core/lib/core/logger.rb +0 -28
- data/plugins/file_parser/lib/file_parser.rb +0 -125
- data/plugins/file_parser/plugin.rb +0 -7
- data/plugins/tree/plugin.rb +0 -9
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
require File.join(File.dirname(__FILE__), "..", "spec_helper")
|
3
|
+
|
4
|
+
describe Redcar::Plugin::SharedStorage do
|
5
|
+
|
6
|
+
before do
|
7
|
+
remove_test_files
|
8
|
+
end
|
9
|
+
|
10
|
+
after do
|
11
|
+
remove_test_files
|
12
|
+
end
|
13
|
+
|
14
|
+
def remove_test_files
|
15
|
+
FileUtils.rm_rf(Redcar::Plugin::Storage.new('test_shared_storage').send(:path))
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should set the default when it is not already set and the value is an Array" do
|
19
|
+
storage = Redcar::Plugin::SharedStorage.new("test_shared_storage")
|
20
|
+
storage.set_or_update_default('a', ['b', 'c'])
|
21
|
+
storage['a'].should == ['b', 'c']
|
22
|
+
storage = Redcar::Plugin::SharedStorage.new("test_shared_storage")
|
23
|
+
storage['a'].should == ['b', 'c']
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should set the default when it is not already and the value is not an Array" do
|
27
|
+
storage = Redcar::Plugin::SharedStorage.new("test_shared_storage")
|
28
|
+
storage.set_or_update_default('a', 'b')
|
29
|
+
storage['a'].should == ['b']
|
30
|
+
storage = Redcar::Plugin::SharedStorage.new("test_shared_storage")
|
31
|
+
storage['a'].should == ['b']
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should update the default when it is already set and the value is an Array" do
|
35
|
+
storage = Redcar::Plugin::SharedStorage.new("test_shared_storage")
|
36
|
+
storage.set_or_update_default('a', 'b')
|
37
|
+
storage = Redcar::Plugin::SharedStorage.new("test_shared_storage")
|
38
|
+
storage.set_or_update_default('a', 'c')
|
39
|
+
storage['a'].should == ['b', 'c']
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should update the default when it is already set and the value is not an Array" do
|
43
|
+
storage = Redcar::Plugin::SharedStorage.new("test_shared_storage")
|
44
|
+
storage.set_or_update_default('a', 'b')
|
45
|
+
storage = Redcar::Plugin::SharedStorage.new("test_shared_storage")
|
46
|
+
storage.set_or_update_default('a', ['c', 'd'])
|
47
|
+
storage['a'].should == ['b', 'c', 'd']
|
48
|
+
end
|
49
|
+
end
|
@@ -3,75 +3,25 @@ require File.join(File.dirname(__FILE__), "..", "spec_helper")
|
|
3
3
|
|
4
4
|
describe Redcar::Plugin::Storage do
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
it "should be based on Redcar::Plugin::BaseStorage" do
|
7
|
+
Redcar::Plugin::Storage.ancestors.should include(Redcar::Plugin::BaseStorage)
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
it "should have a default storage path" do
|
11
|
+
Redcar::Plugin::Storage.storage_dir.should == File.join(Redcar.user_dir, "storage")
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
it "should have a configurable storage path" do
|
15
|
+
old_storage_dir = Redcar::Plugin::Storage.storage_dir
|
16
|
+
Redcar::Plugin::Storage.storage_dir = File.dirname(__FILE__)
|
17
|
+
Redcar::Plugin::Storage.storage_dir.should == File.dirname(__FILE__)
|
18
|
+
Redcar::Plugin::Storage.storage_dir = old_storage_dir
|
17
19
|
end
|
18
20
|
|
19
|
-
it "
|
20
|
-
|
21
|
-
storage
|
22
|
-
storage
|
23
|
-
storage[:some_key] = "some other value"
|
24
|
-
storage[:some_key].should == "some other value"
|
21
|
+
it "should store files inside the directory specified by storage path" do
|
22
|
+
Redcar::Plugin::Storage.storage_dir = File.dirname(__FILE__)
|
23
|
+
storage = Redcar::Plugin::Storage.new('test_storage')
|
24
|
+
storage.send(:path).should == File.join(File.dirname(__FILE__), 'test_storage.yaml')
|
25
25
|
end
|
26
|
-
|
27
|
-
it "saves to disk" do
|
28
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved')
|
29
|
-
storage[:some_key] = "some value"
|
30
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved')
|
31
|
-
storage[:some_key].should == "some value"
|
32
26
|
|
33
|
-
FileUtils.rm_rf(storage.send(:path))
|
34
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved')
|
35
|
-
storage[:some_key].should be_nil
|
36
|
-
end
|
37
|
-
|
38
|
-
it "has a set default method" do
|
39
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved')
|
40
|
-
storage.set_default('a', 'b')
|
41
|
-
storage['a'].should == 'b'
|
42
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved')
|
43
|
-
storage['a'].should == 'b'
|
44
|
-
storage['a'] = 'c'
|
45
|
-
storage['a'].should == 'c'
|
46
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved')
|
47
|
-
storage['a'].should == 'c'
|
48
|
-
storage['b'] = false
|
49
|
-
storage.set_default('b', true)
|
50
|
-
storage['b'].should == false
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should have the default work when that's the first method called" do
|
54
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved2')
|
55
|
-
FileUtils.touch(storage.send(:path))
|
56
|
-
lambda { storage.rollback }.should raise_error(RuntimeError)
|
57
|
-
FileUtils.rm(storage.send(:path))
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should reload when the storage file itself has been elsewise modified" do
|
61
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved')
|
62
|
-
storage['a'] = 'b'
|
63
|
-
storage['a'].should == 'b'
|
64
|
-
storage['a'].should == 'b'
|
65
|
-
sleep 1 # windows doesn't have finer granularity than this
|
66
|
-
File.open(storage.send(:path), 'w') do |f|
|
67
|
-
f.write "---
|
68
|
-
a: new"
|
69
|
-
end
|
70
|
-
storage['a'].should == 'new'
|
71
|
-
storage['a'].should == 'new'
|
72
|
-
storage = Redcar::Plugin::Storage.new('test_storage_saved')
|
73
|
-
storage['a'].should == 'new'
|
74
|
-
end
|
75
|
-
|
76
|
-
|
77
27
|
end
|
@@ -11,7 +11,9 @@ module Redcar
|
|
11
11
|
Menu::Builder.build do
|
12
12
|
sub_menu "Project" do
|
13
13
|
item "Go to declaration", :command => Declarations::GoToTagCommand, :priority => 30
|
14
|
-
|
14
|
+
sub_menu "Refresh", :priority => 31 do
|
15
|
+
item "Declarations file", :command => Declarations::RebuildTagsCommand
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -8,16 +8,18 @@ Feature: Replace in file
|
|
8
8
|
Scenario: Open replace speedbar
|
9
9
|
When I replace the contents with "Foo\nBar\nBaz"
|
10
10
|
And I move the cursor to 0
|
11
|
-
And I open the find
|
12
|
-
Then I should see the find
|
11
|
+
And I open the find speedbar
|
12
|
+
Then I should see the find speedbar
|
13
13
|
|
14
14
|
Scenario: Replace next occurrence on the same line
|
15
15
|
When I replace the contents with "Foo\nBar Rab Rab\nBaz"
|
16
16
|
And I move the cursor to 4
|
17
|
-
And I open the find
|
17
|
+
And I open the find speedbar
|
18
18
|
And I type "Rab" into the "Find" field in the speedbar
|
19
19
|
And I type "RABBIT" into the "Replace" field in the speedbar
|
20
20
|
And I press "Replace && Find" in the speedbar
|
21
|
+
Then the selected text should be "Rab"
|
22
|
+
When I press "Replace && Find" in the speedbar
|
21
23
|
Then the contents should be "Foo\nBar RABBIT Rab\nBaz"
|
22
24
|
And the selected text should be "Rab"
|
23
25
|
And the selection range should be from 15 to 18
|
@@ -25,11 +27,12 @@ Feature: Replace in file
|
|
25
27
|
Scenario: Replace next occurrence on the same line twice
|
26
28
|
When I replace the contents with "Foo\nBar Rab Rab\nBaz"
|
27
29
|
And I move the cursor to 4
|
28
|
-
And I open the find
|
30
|
+
And I open the find speedbar
|
29
31
|
And I type "Rab" into the "Find" field in the speedbar
|
30
32
|
And I type "RAB" into the "Replace" field in the speedbar
|
31
33
|
And I press "Replace && Find" in the speedbar
|
32
34
|
And I press "Replace && Find" in the speedbar
|
35
|
+
And I press "Replace && Find" in the speedbar
|
33
36
|
Then the contents should be "Foo\nBar RAB RAB\nBaz"
|
34
37
|
And the selected text should be "RAB"
|
35
38
|
And the selection range should be from 8 to 11
|
@@ -37,10 +40,11 @@ Feature: Replace in file
|
|
37
40
|
Scenario: Replace next occurrence
|
38
41
|
When I replace the contents with "Foo\nBar\nBaz\nBar\nQux"
|
39
42
|
And I move the cursor to 0
|
40
|
-
And I open the find
|
43
|
+
And I open the find speedbar
|
41
44
|
And I type "Bar" into the "Find" field in the speedbar
|
42
45
|
And I type "Rab" into the "Replace" field in the speedbar
|
43
46
|
And I press "Replace && Find" in the speedbar
|
47
|
+
And I press "Replace && Find" in the speedbar
|
44
48
|
Then the contents should be "Foo\nRab\nBaz\nBar\nQux"
|
45
49
|
And the selected text should be "Bar"
|
46
50
|
And the selection should be on line 3
|
@@ -48,29 +52,32 @@ Feature: Replace in file
|
|
48
52
|
Scenario: Replace next occurrence twice
|
49
53
|
When I replace the contents with "Foo\nBar\nBaz\nBar\nQux"
|
50
54
|
And I move the cursor to 0
|
51
|
-
And I open the find
|
55
|
+
And I open the find speedbar
|
52
56
|
And I type "Bar" into the "Find" field in the speedbar
|
53
57
|
And I type "Rab" into the "Replace" field in the speedbar
|
54
58
|
And I press "Replace && Find" in the speedbar
|
59
|
+
And I press "Replace && Find" in the speedbar
|
55
60
|
Then the contents should be "Foo\nRab\nBaz\nBar\nQux"
|
56
61
|
When I press "Replace && Find" in the speedbar
|
62
|
+
And I press "Replace && Find" in the speedbar
|
57
63
|
Then the contents should be "Foo\nRab\nBaz\nRab\nQux"
|
58
64
|
And there should not be any text selected
|
59
65
|
|
60
66
|
Scenario: Replace next occurrence wraps
|
61
67
|
When I replace the contents with "Foo\nBar\nBaz"
|
62
68
|
And I move the cursor to 8
|
63
|
-
And I open the find
|
69
|
+
And I open the find speedbar
|
64
70
|
And I type "Bar" into the "Find" field in the speedbar
|
65
71
|
And I type "Rab" into the "Replace" field in the speedbar
|
66
72
|
When I press "Replace && Find" in the speedbar
|
73
|
+
When I press "Replace && Find" in the speedbar
|
67
74
|
Then the contents should be "Foo\nRab\nBaz"
|
68
75
|
And there should not be any text selected
|
69
76
|
|
70
77
|
Scenario: Replace all replaces one
|
71
78
|
When I replace the contents with "Foo\nBar\nBaz"
|
72
79
|
And I move the cursor to 0
|
73
|
-
And I open the find
|
80
|
+
And I open the find speedbar
|
74
81
|
And I type "Bar" into the "Find" field in the speedbar
|
75
82
|
And I type "Rab" into the "Replace" field in the speedbar
|
76
83
|
When I press "Replace All" in the speedbar
|
@@ -81,7 +88,7 @@ Feature: Replace in file
|
|
81
88
|
Scenario: Replace all replaces two
|
82
89
|
When I replace the contents with "Foo\nBar\nBaz\nBar\nQux"
|
83
90
|
And I move the cursor to 0
|
84
|
-
And I open the find
|
91
|
+
And I open the find speedbar
|
85
92
|
And I type "Bar" into the "Find" field in the speedbar
|
86
93
|
And I type "Rab" into the "Replace" field in the speedbar
|
87
94
|
When I press "Replace All" in the speedbar
|
@@ -91,7 +98,7 @@ Feature: Replace in file
|
|
91
98
|
|
92
99
|
Scenario: Replace all replaces two on the same line
|
93
100
|
When I replace the contents with "abcabc"
|
94
|
-
And I open the find
|
101
|
+
And I open the find speedbar
|
95
102
|
And I type "bc" into the "Find" field in the speedbar
|
96
103
|
And I type "xx" into the "Replace" field in the speedbar
|
97
104
|
When I press "Replace All" in the speedbar
|
@@ -99,7 +106,7 @@ Feature: Replace in file
|
|
99
106
|
|
100
107
|
Scenario: Replace all replaces overlapping occurences on the same line
|
101
108
|
When I replace the contents with "deedeedeed"
|
102
|
-
And I open the find
|
109
|
+
And I open the find speedbar
|
103
110
|
And I type "deed" into the "Find" field in the speedbar
|
104
111
|
And I type "misdeed" into the "Replace" field in the speedbar
|
105
112
|
When I press "Replace All" in the speedbar
|
@@ -107,7 +114,7 @@ Feature: Replace in file
|
|
107
114
|
|
108
115
|
Scenario: Replace all is a single undo action
|
109
116
|
When I replace the contents with "abcabc"
|
110
|
-
And I open the find
|
117
|
+
And I open the find speedbar
|
111
118
|
And I type "bc" into the "Find" field in the speedbar
|
112
119
|
And I type "xx" into the "Replace" field in the speedbar
|
113
120
|
When I press "Replace All" in the speedbar
|
@@ -118,13 +125,14 @@ Feature: Replace in file
|
|
118
125
|
Scenario: Replace next occurrence test bug
|
119
126
|
When I replace the contents with "the\n* Speedbars have access to the properties of the widgets in them."
|
120
127
|
And I move the cursor to 0
|
121
|
-
And I open the find
|
128
|
+
And I open the find speedbar
|
122
129
|
And I type "the" into the "Find" field in the speedbar
|
123
130
|
And I type "THE" into the "Replace" field in the speedbar
|
124
131
|
And I press "Replace && Find" in the speedbar
|
132
|
+
And I press "Replace && Find" in the speedbar
|
125
133
|
Then the contents should be "THE\n* Speedbars have access to the properties of the widgets in them."
|
126
134
|
And the selection range should be from 31 to 34
|
127
|
-
|
135
|
+
When I press "Replace && Find" in the speedbar
|
128
136
|
Then the contents should be "THE\n* Speedbars have access to THE properties of the widgets in them."
|
129
137
|
And the selection range should be from 49 to 52
|
130
138
|
And I press "Replace && Find" in the speedbar
|
@@ -138,22 +146,24 @@ Feature: Replace in file
|
|
138
146
|
Scenario: Replace regex with back-references
|
139
147
|
When I replace the contents with "Curry chicken"
|
140
148
|
And I move the cursor to 0
|
141
|
-
And I open the find
|
142
|
-
And I
|
149
|
+
And I open the find speedbar
|
150
|
+
And I check "Regex" in the speedbar
|
143
151
|
And I type "(\w+) chicken" into the "Find" field in the speedbar
|
144
152
|
And I type "\1 beef" into the "Replace" field in the speedbar
|
145
153
|
And I press "Replace && Find" in the speedbar
|
154
|
+
And I press "Replace && Find" in the speedbar
|
146
155
|
Then the contents should be "Curry beef"
|
147
156
|
|
148
157
|
Scenario: Replace should move past the current replacement if the query is a substring of the replacement
|
149
158
|
When I replace the contents with "foo\nfoo\nfoo"
|
150
159
|
And I move the cursor to 0
|
151
|
-
And I open the find
|
160
|
+
And I open the find speedbar
|
152
161
|
And I type "foo" into the "Find" field in the speedbar
|
153
162
|
And I type "foobar" into the "Replace" field in the speedbar
|
154
163
|
And I press "Replace && Find" in the speedbar
|
155
164
|
And I press "Replace && Find" in the speedbar
|
156
165
|
And I press "Replace && Find" in the speedbar
|
166
|
+
And I press "Replace && Find" in the speedbar
|
157
167
|
Then the contents should be "foobar\nfoobar\nfoobar"
|
158
168
|
And the selected text should be "foo"
|
159
169
|
And the selection should be on line 0
|
@@ -161,9 +171,8 @@ Feature: Replace in file
|
|
161
171
|
Scenario: The Search-and-Replace Speedbar should get initialized with the currently selected text
|
162
172
|
When I replace the contents with "Foo\nBar\nFoo"
|
163
173
|
And I select from 4 to 7
|
164
|
-
When I open the find
|
174
|
+
When I open the find speedbar
|
165
175
|
Then the "Find" field in the speedbar should have text "Bar"
|
166
176
|
When I type "Foo" into the "Replace" field in the speedbar
|
167
177
|
And I press "Replace && Find" in the speedbar
|
168
|
-
Then the contents should be "Foo\nFoo\nFoo"
|
169
|
-
|
178
|
+
Then the contents should be "Foo\nFoo\nFoo"
|
@@ -90,7 +90,10 @@ module Redcar
|
|
90
90
|
(@initial_query == FindSpeedbar.previous_replace))
|
91
91
|
self.query.value = FindSpeedbar.previous_query
|
92
92
|
else
|
93
|
-
|
93
|
+
if (@initial_query)
|
94
|
+
FindSpeedbar.previous_query = @initial_query
|
95
|
+
end
|
96
|
+
self.query.value = FindSpeedbar.previous_query
|
94
97
|
end
|
95
98
|
self.replace.value = FindSpeedbar.previous_replace || ""
|
96
99
|
self.is_regex.value = FindSpeedbar.previous_options.is_regex
|
@@ -5,7 +5,7 @@ Feature: Indentation commands
|
|
5
5
|
And tabs are soft, 2 spaces
|
6
6
|
And I run the command Redcar::Top::IncreaseIndentCommand
|
7
7
|
Then the contents should be " "
|
8
|
-
|
8
|
+
|
9
9
|
Scenario: Decrease indent, soft tabs, width 2
|
10
10
|
When I open a new edit tab
|
11
11
|
And tabs are soft, 2 spaces
|
@@ -18,7 +18,7 @@ Feature: Indentation commands
|
|
18
18
|
And tabs are soft, 3 spaces
|
19
19
|
And I run the command Redcar::Top::IncreaseIndentCommand
|
20
20
|
Then the contents should be " "
|
21
|
-
|
21
|
+
|
22
22
|
Scenario: Decrease indent, soft tabs, width 3
|
23
23
|
When I open a new edit tab
|
24
24
|
And tabs are soft, 3 spaces
|
@@ -31,18 +31,19 @@ Feature: Indentation commands
|
|
31
31
|
And tabs are hard
|
32
32
|
And I run the command Redcar::Top::IncreaseIndentCommand
|
33
33
|
Then the contents should be "\t"
|
34
|
-
|
34
|
+
|
35
35
|
Scenario: Decrease indent, hard tabs, width 2
|
36
36
|
When I open a new edit tab
|
37
37
|
And tabs are hard
|
38
38
|
And I replace the contents with "<c>\t\t"
|
39
39
|
And I run the command Redcar::Top::DecreaseIndentCommand
|
40
40
|
Then the contents should be "\t"
|
41
|
-
|
41
|
+
|
42
42
|
Scenario: auto-indent, soft tabs, width 2
|
43
|
+
Given the indentation rules are like Ruby's
|
43
44
|
When I open a new edit tab
|
44
45
|
And tabs are soft, 2 spaces
|
45
46
|
And I replace the contents with "def f\n\t1\t\t\nend\t"
|
46
47
|
And I select from 0 to 13
|
47
48
|
And I run the command Redcar::AutoIndenter::IndentCommand
|
48
|
-
Then the contents should be "def f\n 1\nend"
|
49
|
+
Then the contents should be "def f\n 1\nend"
|
@@ -16,19 +16,19 @@ end
|
|
16
16
|
World(NotebookSwtHelper)
|
17
17
|
|
18
18
|
When /^I make a new notebook$/ do
|
19
|
-
Redcar::
|
19
|
+
Redcar::Application::OpenNewNotebookCommand.new.run
|
20
20
|
end
|
21
21
|
|
22
22
|
When /^I move the tab to the other notebook$/ do
|
23
|
-
Redcar::
|
23
|
+
Redcar::Application::MoveTabToOtherNotebookCommand.new.run
|
24
24
|
end
|
25
25
|
|
26
26
|
When /^I close the current notebook$/ do
|
27
|
-
Redcar::
|
27
|
+
Redcar::Application::CloseNotebookCommand.new.run
|
28
28
|
end
|
29
29
|
|
30
30
|
When /^I switch notebooks$/ do
|
31
|
-
Redcar::
|
31
|
+
Redcar::Application::SwitchNotebookCommand.new.run
|
32
32
|
end
|
33
33
|
|
34
34
|
When /^I focus on the edit_view in the tab in notebook (\d)$/ do |index|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
Given /^there is an edit tab containing "([^\"]*)"$/ do |contents|
|
3
|
-
tab = Redcar::Top::
|
3
|
+
tab = Redcar::Top::OpenNewEditTabCommand.new.run
|
4
4
|
contents = eval(contents.inspect.gsub("\\\\", "\\"))
|
5
5
|
cursor_offset = (contents =~ /<c>/)
|
6
6
|
contents = contents.gsub("<c>", "")
|
@@ -11,28 +11,28 @@ Given /^there is an edit tab containing "([^\"]*)"$/ do |contents|
|
|
11
11
|
end
|
12
12
|
|
13
13
|
When /^I open a new edit tab$/ do
|
14
|
-
Redcar::Top::
|
14
|
+
Redcar::Top::OpenNewEditTabCommand.new.run
|
15
15
|
end
|
16
16
|
|
17
17
|
When /^I close the focussed tab$/ do
|
18
|
-
Redcar::
|
18
|
+
Redcar::Application::CloseTabCommand.new.run
|
19
19
|
end
|
20
20
|
|
21
21
|
When /I switch (up|down) a tab/ do |type|
|
22
22
|
case type
|
23
23
|
when "down"
|
24
|
-
Redcar::
|
24
|
+
Redcar::Application::SwitchTabDownCommand.new.run
|
25
25
|
when "up"
|
26
|
-
Redcar::
|
26
|
+
Redcar::Application::SwitchTabUpCommand.new.run
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
When /I move (up|down) a tab/ do |type|
|
31
31
|
case type
|
32
32
|
when "down"
|
33
|
-
Redcar::
|
33
|
+
Redcar::Application::MoveTabDownCommand.new.run
|
34
34
|
when "up"
|
35
|
-
Redcar::
|
35
|
+
Redcar::Application::MoveTabUpCommand.new.run
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -22,7 +22,7 @@ Then /^there should be (no|one|\d+) windows?$/ do |num|
|
|
22
22
|
end
|
23
23
|
|
24
24
|
When /I open a new window(?: with title "(.*)")?/ do |title|
|
25
|
-
Redcar::
|
25
|
+
Redcar::Application::OpenNewWindowCommand.new(title).run
|
26
26
|
end
|
27
27
|
|
28
28
|
When /^I maximize the window size$/ do
|
@@ -40,7 +40,7 @@ When /I close the window(?: "(.*)")?( with a command| through the gui)?/ do |tit
|
|
40
40
|
win = nil
|
41
41
|
end
|
42
42
|
if how =~ /command/
|
43
|
-
Redcar::
|
43
|
+
Redcar::Application::CloseWindowCommand.new(win).run
|
44
44
|
else
|
45
45
|
unless win
|
46
46
|
display = Swt::Widgets::Display.get_current
|