redcar 0.9.2 → 0.10

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 (234) hide show
  1. data/CHANGES +34 -4
  2. data/Rakefile +2 -1
  3. data/lib/redcar.rb +3 -3
  4. data/lib/redcar/installer.rb +2 -3
  5. data/plugins/application/features/step_definitions/dialog_steps.rb +7 -0
  6. data/plugins/application/features/step_definitions/key_steps.rb +18 -0
  7. data/plugins/application/features/step_definitions/menu_steps.rb +5 -6
  8. data/plugins/application/features/step_definitions/speedbar_steps.rb +29 -9
  9. data/plugins/application/features/step_definitions/tree_steps.rb +13 -0
  10. data/plugins/application/features/support/env.rb +39 -5
  11. data/plugins/application/features/support/fake_event.rb +12 -0
  12. data/plugins/application/lib/application.rb +5 -6
  13. data/plugins/application/lib/application/dialog.rb +53 -10
  14. data/plugins/application/lib/application/dialogs/modeless_list_dialog.rb +85 -0
  15. data/plugins/application/lib/application/keymap.rb +10 -8
  16. data/plugins/application/lib/application/menu.rb +38 -16
  17. data/plugins/application/lib/application/treebook.rb +30 -0
  18. data/plugins/application/lib/application/window.rb +20 -2
  19. data/plugins/application/spec/application/command/executor_spec.rb +1 -0
  20. data/plugins/application/spec/application/menu_spec.rb +26 -26
  21. data/plugins/application/spec/application/treebook_spec.rb +6 -6
  22. data/plugins/application/spec/spec_helper.rb +10 -1
  23. data/plugins/application_swt/lib/application_swt.rb +25 -3
  24. data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +48 -27
  25. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +22 -11
  26. data/plugins/application_swt/lib/application_swt/dialogs/modeless_dialog.rb +113 -0
  27. data/plugins/application_swt/lib/application_swt/dialogs/modeless_html_dialog.rb +85 -0
  28. data/plugins/application_swt/lib/application_swt/dialogs/modeless_list_dialog_controller.rb +143 -0
  29. data/plugins/application_swt/lib/application_swt/gradient.rb +61 -0
  30. data/plugins/application_swt/lib/application_swt/menu/binding_translator.rb +4 -4
  31. data/plugins/application_swt/lib/application_swt/notebook.rb +5 -8
  32. data/plugins/application_swt/lib/application_swt/speedbar.rb +1 -0
  33. data/plugins/application_swt/lib/application_swt/treebook.rb +6 -8
  34. data/plugins/application_swt/lib/application_swt/window.rb +85 -57
  35. data/plugins/application_swt/lib/swt/graphics_utils.rb +23 -0
  36. data/plugins/application_swt/lib/swt/vtab_folder.rb +7 -0
  37. data/plugins/application_swt/lib/swt/vtab_label.rb +1 -1
  38. data/plugins/application_swt/spec/application_swt/gradient_spec.rb +142 -0
  39. data/plugins/auto_completer/lib/auto_completer.rb +10 -42
  40. data/plugins/auto_completer/lib/auto_completer/list_dialog.rb +21 -0
  41. data/plugins/clojure/lib/clojure.rb +33 -0
  42. data/plugins/{repl/lib/repl/clojure_mirror.rb → clojure/lib/clojure/repl_mirror.rb} +16 -20
  43. data/plugins/clojure/plugin.rb +9 -0
  44. data/plugins/{repl/spec/repl/clojure_mirror_spec.rb → clojure/spec/clojure/repl_mirror_spec.rb} +12 -13
  45. data/plugins/clojure/spec/spec_helper.rb +5 -0
  46. data/plugins/{repl → clojure}/vendor/Wrapper.clj +0 -0
  47. data/plugins/{repl → clojure}/vendor/dummy +0 -0
  48. data/plugins/{repl → clojure}/vendor/enclojure-wrapper.jar +0 -0
  49. data/plugins/connection_manager/lib/connection_manager.rb +13 -13
  50. data/plugins/declarations/lib/declarations.rb +17 -6
  51. data/plugins/document_search/features/find.feature +389 -0
  52. data/plugins/document_search/features/find_and_replace.feature +723 -0
  53. data/plugins/document_search/features/replace.feature +69 -62
  54. data/plugins/document_search/lib/document_search.rb +81 -64
  55. data/plugins/document_search/lib/document_search/commands.rb +258 -0
  56. data/plugins/document_search/lib/document_search/find_and_replace_speedbar.rb +142 -0
  57. data/plugins/document_search/lib/document_search/find_speedbar.rb +102 -0
  58. data/plugins/document_search/lib/document_search/query_options.rb +45 -0
  59. data/plugins/edit_view/features/case_change.feature +9 -5
  60. data/plugins/edit_view/features/step_definitions/editing_steps.rb +19 -0
  61. data/plugins/edit_view/lib/edit_view.rb +15 -12
  62. data/plugins/edit_view/lib/edit_view/actions/arrow_keys.rb +12 -2
  63. data/plugins/edit_view/lib/edit_view/commands/text_conversion_commands.rb +1 -1
  64. data/plugins/edit_view/lib/edit_view/document.rb +129 -99
  65. data/plugins/edit_view_swt/lib/edit_view_swt.rb +33 -15
  66. data/plugins/encryption/encryption.rb +2 -0
  67. data/plugins/find-in-project/lib/find_in_project.rb +3 -5
  68. data/plugins/find-in-project/lib/find_in_project/views/index.html.erb +2 -0
  69. data/plugins/groovy/features/step_definitions/groovy_steps.rb +2 -2
  70. data/plugins/groovy/features/syntax_check_groovy.feature +3 -3
  71. data/plugins/groovy/lib/groovy.rb +38 -0
  72. data/plugins/groovy/lib/groovy/commands.rb +10 -0
  73. data/plugins/{repl/lib/repl/groovy_mirror.rb → groovy/lib/groovy/repl_mirror.rb} +33 -13
  74. data/plugins/groovy/lib/{syntax_check/groovy.rb → groovy/syntax_checker.rb} +13 -8
  75. data/plugins/groovy/plugin.rb +5 -4
  76. data/plugins/{repl/spec/repl/groovy_mirror_spec.rb → groovy/spec/groovy/repl_mirror_spec.rb} +14 -13
  77. data/plugins/groovy/spec/spec_helper.rb +5 -0
  78. data/plugins/html_view/assets/json2.js +476 -0
  79. data/plugins/html_view/lib/html_view.rb +1 -0
  80. data/plugins/java/features/fixtures/test.java +0 -0
  81. data/plugins/java/features/support/env.rb +27 -0
  82. data/plugins/java/features/syntax_check_java.feature +86 -0
  83. data/plugins/java/lib/syntax_check/java.rb +86 -0
  84. data/plugins/java/plugin.rb +7 -0
  85. data/plugins/javascript/features/fixtures/test2.js +5 -0
  86. data/plugins/javascript/features/step_definitions/javascript_steps.rb +16 -0
  87. data/plugins/javascript/features/support/env.rb +14 -0
  88. data/plugins/javascript/features/syntax_check_javascript.feature +46 -3
  89. data/plugins/javascript/lib/syntax_check/javascript.rb +15 -9
  90. data/plugins/line_tools/features/trim_line.feature +49 -0
  91. data/plugins/line_tools/lib/line_tools.rb +5 -1
  92. data/plugins/mirah/README +7 -0
  93. data/plugins/mirah/features/fixtures/test.mirah +2 -0
  94. data/plugins/mirah/features/syntax_check_mirah.feature +46 -0
  95. data/plugins/mirah/lib/mirah.rb +43 -0
  96. data/plugins/mirah/lib/mirah/my_error_handler.rb +22 -0
  97. data/plugins/mirah/lib/mirah/repl_mirror.rb +50 -0
  98. data/plugins/mirah/lib/mirah/syntax_checker.rb +38 -0
  99. data/plugins/mirah/plugin.rb +8 -0
  100. data/plugins/mirah/spec/mirah/repl_mirror_spec.rb +188 -0
  101. data/plugins/mirah/spec/spec_helper.rb +5 -0
  102. data/plugins/mirah/vendor/mirah-parser.jar +0 -0
  103. data/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb +24 -23
  104. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +10 -1
  105. data/plugins/plugin_manager_ui/views/index.html.erb +2 -0
  106. data/plugins/project/features/find_file.feature +40 -16
  107. data/plugins/project/features/highlight_focussed_tab.feature +16 -10
  108. data/plugins/project/features/step_definitions/find_file_steps.rb +11 -0
  109. data/plugins/project/features/step_definitions/project_tree_steps.rb +5 -1
  110. data/plugins/project/features/support/env.rb +5 -0
  111. data/plugins/project/lib/project/commands.rb +8 -1
  112. data/plugins/project/lib/project/dir_controller.rb +4 -1
  113. data/plugins/project/lib/project/find_file_dialog.rb +16 -12
  114. data/plugins/project/lib/project/manager.rb +30 -1
  115. data/plugins/project_search/vendor/lucene/CHANGELOG +147 -0
  116. data/plugins/project_search/vendor/lucene/CONTRIBUTORS +17 -0
  117. data/plugins/project_search/vendor/lucene/Gemfile +9 -0
  118. data/plugins/project_search/vendor/lucene/Gemfile.lock +33 -0
  119. data/plugins/project_search/vendor/lucene/LICENSE +19 -0
  120. data/plugins/project_search/vendor/lucene/README.rdoc +283 -0
  121. data/plugins/project_search/vendor/lucene/Rakefile +35 -0
  122. data/plugins/project_search/vendor/lucene/examples/active_model/serializers.rb +25 -0
  123. data/plugins/project_search/vendor/lucene/examples/active_model/validation.rb +26 -0
  124. data/plugins/project_search/vendor/lucene/examples/admin/Rakefile +4 -0
  125. data/plugins/project_search/vendor/lucene/examples/admin/admin.rb +29 -0
  126. data/plugins/project_search/vendor/lucene/examples/admin/public/jquery.js +4376 -0
  127. data/plugins/project_search/vendor/lucene/examples/admin/public/neo4j.css +153 -0
  128. data/plugins/project_search/vendor/lucene/examples/admin/public/neo_admin.js +18 -0
  129. data/plugins/project_search/vendor/lucene/examples/admin/spec/admin_spec.rb +26 -0
  130. data/plugins/project_search/vendor/lucene/examples/admin/views/index.erb +21 -0
  131. data/plugins/project_search/vendor/lucene/examples/filetree/README.rdoc +9 -0
  132. data/plugins/project_search/vendor/lucene/examples/filetree/app.rb +7 -0
  133. data/plugins/project_search/vendor/lucene/examples/filetree/batch.props +5 -0
  134. data/plugins/project_search/vendor/lucene/examples/filetree/features/step_definitions/add_steps.rb +121 -0
  135. data/plugins/project_search/vendor/lucene/examples/filetree/features/support/env.rb +30 -0
  136. data/plugins/project_search/vendor/lucene/examples/filetree/features/support/rspec_helper.rb +50 -0
  137. data/plugins/project_search/vendor/lucene/examples/filetree/features/treesizes.feature +19 -0
  138. data/plugins/project_search/vendor/lucene/examples/imdb/1_create_neo_db.rb +66 -0
  139. data/plugins/project_search/vendor/lucene/examples/imdb/2_index_db.rb +23 -0
  140. data/plugins/project_search/vendor/lucene/examples/imdb/README +12 -0
  141. data/plugins/project_search/vendor/lucene/examples/imdb/find_actors.rb +56 -0
  142. data/plugins/project_search/vendor/lucene/examples/imdb/install.sh +12 -0
  143. data/plugins/project_search/vendor/lucene/examples/imdb/model.rb +37 -0
  144. data/plugins/project_search/vendor/lucene/examples/railway/README +111 -0
  145. data/plugins/project_search/vendor/lucene/examples/railway/railnet-app.rb +31 -0
  146. data/plugins/project_search/vendor/lucene/examples/railway/railnet-data.rb +42 -0
  147. data/plugins/project_search/vendor/lucene/examples/rest/example.rb +41 -0
  148. data/plugins/project_search/vendor/lucene/examples/you_might_know/YouMightKnow.java +60 -0
  149. data/plugins/project_search/vendor/lucene/examples/you_might_know/all_simple_paths.rb +34 -0
  150. data/plugins/project_search/vendor/lucene/examples/you_might_know/nodes.rb +34 -0
  151. data/plugins/project_search/vendor/lucene/examples/you_might_know/you_might_know.rb +50 -0
  152. data/plugins/project_search/vendor/lucene/lib/lucene.rb +15 -0
  153. data/plugins/project_search/vendor/lucene/lib/lucene/config.rb +145 -0
  154. data/plugins/project_search/vendor/lucene/lib/lucene/document.rb +96 -0
  155. data/plugins/project_search/vendor/lucene/lib/lucene/field_info.rb +144 -0
  156. data/plugins/project_search/vendor/lucene/lib/lucene/hits.rb +54 -0
  157. data/plugins/project_search/vendor/lucene/lib/lucene/index.rb +267 -0
  158. data/plugins/project_search/vendor/lucene/lib/lucene/index_info.rb +146 -0
  159. data/plugins/project_search/vendor/lucene/lib/lucene/index_searcher.rb +157 -0
  160. data/plugins/project_search/vendor/lucene/lib/lucene/jars.rb +5 -0
  161. data/plugins/project_search/vendor/lucene/lib/lucene/query_dsl.rb +135 -0
  162. data/plugins/project_search/vendor/lucene/lib/lucene/transaction.rb +117 -0
  163. data/plugins/project_search/vendor/lucene/lib/lucene/version.rb +3 -0
  164. data/plugins/project_search/vendor/lucene/lucene.gemspec +23 -0
  165. data/plugins/project_search/vendor/lucene/spec/lucene/document_spec.rb +32 -0
  166. data/plugins/project_search/vendor/lucene/spec/lucene/field_info_spec.rb +70 -0
  167. data/plugins/project_search/vendor/lucene/spec/lucene/index_info_spec.rb +76 -0
  168. data/plugins/project_search/vendor/lucene/spec/lucene/index_spec.rb +643 -0
  169. data/plugins/project_search/vendor/lucene/spec/lucene/query_dsl_spec.rb +142 -0
  170. data/plugins/project_search/vendor/lucene/spec/lucene/sort_spec.rb +101 -0
  171. data/plugins/project_search/vendor/lucene/spec/lucene/spec_helper.rb +10 -0
  172. data/plugins/project_search/vendor/lucene/spec/lucene/transaction_spec.rb +118 -0
  173. data/plugins/redcar/features/alter_font_size.feature +25 -0
  174. data/plugins/redcar/features/step_definitions/font_steps.rb +34 -0
  175. data/plugins/redcar/redcar.rb +256 -43
  176. data/plugins/repl/features/command_editing.feature +55 -0
  177. data/plugins/repl/features/command_history.feature +75 -0
  178. data/plugins/repl/features/step_definitions/repl_steps.rb +17 -1
  179. data/plugins/repl/features/support/env.rb +24 -0
  180. data/plugins/repl/features/support/fake_repl.rb +16 -0
  181. data/plugins/repl/lib/repl.rb +17 -74
  182. data/plugins/repl/lib/repl/repl_command.rb +20 -0
  183. data/plugins/repl/lib/repl/repl_mirror.rb +168 -22
  184. data/plugins/repl/lib/repl/repl_tab.rb +131 -6
  185. data/plugins/repl/plugin.rb +1 -1
  186. data/plugins/repl/spec/repl/repl_mirror_spec.rb +72 -0
  187. data/plugins/repl/spec/spec_helper.rb +1 -1
  188. data/plugins/repl_swt/lib/repl_swt.rb +7 -0
  189. data/plugins/repl_swt/lib/repl_swt/key_listener.rb +43 -0
  190. data/plugins/repl_swt/plugin.rb +8 -0
  191. data/plugins/ruby/lib/ruby.rb +35 -0
  192. data/plugins/{repl/lib/repl/ruby_mirror.rb → ruby/lib/ruby/repl_mirror.rb} +12 -12
  193. data/plugins/ruby/lib/{syntax_check/ruby.rb → ruby/syntax_checker.rb} +3 -3
  194. data/plugins/ruby/plugin.rb +5 -4
  195. data/plugins/{repl/spec/repl/ruby_mirror_spec.rb → ruby/spec/ruby/repl_mirror_spec.rb} +38 -29
  196. data/plugins/ruby/spec/spec_helper.rb +5 -0
  197. data/plugins/runnables/lib/runnables.rb +2 -0
  198. data/plugins/runnables/lib/runnables/command_output_controller.rb +5 -0
  199. data/plugins/runnables/lib/runnables/output_processor.rb +14 -3
  200. data/plugins/runnables/views/command_output.html.erb +3 -2
  201. data/plugins/scm/lib/scm.rb +4 -2
  202. data/plugins/scm/lib/scm/diff_mirror.rb +6 -6
  203. data/plugins/scm_git/lib/scm_git.rb +136 -107
  204. data/plugins/scm_git/lib/scm_git/change.rb +28 -19
  205. data/plugins/snippets/lib/snippets/explorer.rb +2 -2
  206. data/plugins/swt/lib/swt/full_swt.rb +1 -0
  207. data/plugins/syntax_check/features/step_definitions/syntax_check_steps.rb +4 -0
  208. data/plugins/syntax_check/features/support/env.rb +3 -0
  209. data/plugins/syntax_check/lib/syntax_check.rb +71 -5
  210. data/plugins/syntax_check/lib/syntax_check/annotation.rb +61 -0
  211. data/plugins/test_runner/lib/test_runner.rb +39 -0
  212. data/plugins/test_runner/lib/test_runner/rspec_runner.rb +20 -0
  213. data/plugins/test_runner/lib/test_runner/run_test_command.rb +63 -0
  214. data/plugins/test_runner/lib/test_runner/runnable_test_runner.rb +26 -0
  215. data/plugins/test_runner/plugin.rb +8 -0
  216. data/plugins/test_runner/spec/run_test_command_spec.rb +51 -0
  217. data/plugins/test_runner/spec/spec_helper.rb +5 -0
  218. data/plugins/textmate/lib/textmate.rb +12 -2
  219. data/plugins/textmate/vendor/redcar-bundles/Bundles/HTML.tmbundle/Syntaxes/HTML.plist +0 -2
  220. data/plugins/textmate/vendor/redcar-bundles/Bundles/Mirah.tmbundle/Syntaxes/Mirah.plist +22 -0
  221. data/plugins/textmate/vendor/redcar-bundles/Bundles/Mirah.tmbundle/info.plist +12 -0
  222. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby.tmbundle/Syntaxes/Ruby.plist +2 -0
  223. data/plugins/todo_list/lib/todo_list.rb +7 -0
  224. data/plugins/todo_list/lib/todo_list/todo_controller.rb +3 -1
  225. data/plugins/tree/lib/tree.rb +4 -0
  226. data/plugins/tree_view_swt/lib/tree_view_swt.rb +5 -0
  227. data/plugins/web_bookmarks/lib/web_bookmarks.rb +10 -0
  228. metadata +137 -22
  229. data/plugins/document_search/features/search.feature +0 -163
  230. data/plugins/document_search/lib/document_search/replace_all_command.rb +0 -27
  231. data/plugins/document_search/lib/document_search/replace_command.rb +0 -38
  232. data/plugins/document_search/lib/document_search/replace_next_command.rb +0 -27
  233. data/plugins/document_search/lib/document_search/search_and_replace.rb +0 -81
  234. data/plugins/ruby/README +0 -6
@@ -0,0 +1,723 @@
1
+ # Note: Because settings persist, even after the speedbar is closed, any setting changed in a
2
+ # scenario will affect subsequent scenarios. To mitigate the chance of error, please inset a
3
+ # "Current Settings" comment line after each scenario that changes settings.
4
+ #
5
+ # Because the Find speedbar and the find operations of the Find and Replace speedbar are supposed to
6
+ # function identically, all scenarios from find.feature should be copied here, with the references
7
+ # to FindMenuCommand and FindSpeedbar adjusted accordingly.
8
+
9
+ @speedbar
10
+ Feature: Find and Replace
11
+
12
+ Background:
13
+ Given I open a new edit tab
14
+
15
+ Scenario: Open Find and Replace speedbar
16
+ When I replace the contents with "Foo\nBar\nBaz"
17
+ And I move the cursor to 0
18
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
19
+ Then the DocumentSearch::FindAndReplaceSpeedbar speedbar should be open
20
+
21
+ Scenario: Change settings
22
+ When I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
23
+ And I choose "Plain" in the "query_type" field in the speedbar
24
+ And I uncheck "Match case" in the speedbar
25
+ And I check "Wrap around" in the speedbar
26
+ Then "Plain" should be chosen in the "query_type" field in the speedbar
27
+ And "Match case" should not be checked in the speedbar
28
+ And "Wrap around" should be checked in the speedbar
29
+
30
+ # Current Settings: Plain, No Match case, Wrap around
31
+
32
+ Scenario: Search for a word should select next occurrence
33
+ When I replace the contents with "Foo\nBar\nBaz"
34
+ And I move the cursor to 0
35
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
36
+ And I type "Bar" into the "Find" field in the speedbar
37
+ Then the selected text should be "Bar"
38
+
39
+ Scenario: Search twice should move to the next occurrence
40
+ When I replace the contents with "Foo\nBar\nFoo"
41
+ And I move the cursor to 0
42
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
43
+ And I type "Foo" into the "Find" field in the speedbar
44
+ Then the selection should be on line 0
45
+ When I press "Next" in the speedbar
46
+ Then the selected text should be "Foo"
47
+ And the selection should be on line 2
48
+
49
+ Scenario: Search should incrementally update
50
+ When I replace the contents with "Foo\nBaar\nBaaz"
51
+ And I move the cursor to 0
52
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
53
+ And I type "Ba" into the "Find" field in the speedbar
54
+ Then the selected text should be "Ba"
55
+ And the selection should be on line 1
56
+ When I type "Baa" into the "Find" field in the speedbar
57
+ And the selection should be on line 1
58
+ When I type "Baaz" into the "Find" field in the speedbar
59
+ Then the selected text should be "Baaz"
60
+ And the selection should be on line 2
61
+ When I type "Baa" into the "Find" field in the speedbar
62
+ Then the selection should be on line 2
63
+
64
+ Scenario: Search for a word adjacent to cursor should select word
65
+ When I replace the contents with "Foo\nBar\nBaz"
66
+ And I move the cursor to 0
67
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
68
+ And I type "Foo" into the "Find" field in the speedbar
69
+ Then the selected text should be "Foo"
70
+
71
+ Scenario: Search for a word should find occurrence after the cursor
72
+ When I replace the contents with "Foo\nBar\nBaz\nFoo"
73
+ And I move the cursor to 1
74
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
75
+ And I type "Foo" into the "Find" field in the speedbar
76
+ Then the selection should be on line 3
77
+ And the selected text should be "Foo"
78
+ When I press "Next" in the speedbar
79
+ Then the selected text should be "Foo"
80
+ And the selection should be on line 0
81
+
82
+ Scenario: Search for a word should wrap to earlier occurrence if none left
83
+ When I replace the contents with "Foo\nBar\nBaz"
84
+ And I move the cursor to 1
85
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
86
+ And I type "Foo" into the "Find" field in the speedbar
87
+ Then the selected text should be "Foo"
88
+ And the selection should be on line 0
89
+
90
+ Scenario: Doesn't search for a regex
91
+ When I replace the contents with "Foo\nBar\nBaz"
92
+ And I move the cursor to 0
93
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
94
+ And I type "Ba." into the "Find" field in the speedbar
95
+ Then there should not be any text selected
96
+
97
+ Scenario: Search for a regex
98
+ When I replace the contents with "Foo\nBar\nBaz"
99
+ And I move the cursor to 0
100
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
101
+ And I type "Ba." into the "Find" field in the speedbar
102
+ And I choose "Regex" in the "query_type" field in the speedbar
103
+ Then the selected text should be "Bar"
104
+ When I press "Next" in the speedbar
105
+ Then the selected text should be "Baz"
106
+
107
+ # Current Settings: Regex, No Match case, Wrap around
108
+
109
+ Scenario: Search for a regex matches a second time
110
+ When I replace the contents with "Foo\nBar\nBaz"
111
+ And I move the cursor to 0
112
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
113
+ And I type "Ba." into the "Find" field in the speedbar
114
+ Then the selected text should be "Bar"
115
+ When I press "Next" in the speedbar
116
+ Then the selected text should be "Baz"
117
+
118
+ Scenario: Doesn't search for a glob
119
+ When I replace the contents with "Foo\nBar\nBaz"
120
+ And I move the cursor to 0
121
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
122
+ And I choose "Plain" in the "query_type" field in the speedbar
123
+ And I type "Ba*" into the "Find" field in the speedbar
124
+ Then there should not be any text selected
125
+
126
+ Scenario: Search for a glob
127
+ When I replace the contents with "Foo\nBar none I said\nBaz"
128
+ And I move the cursor to 0
129
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
130
+ And I type "Ba*" into the "Find" field in the speedbar
131
+ And I choose "Glob" in the "query_type" field in the speedbar
132
+ Then the selected text should be "Bar none I said"
133
+ When I press "Next" in the speedbar
134
+ Then the selected text should be "Baz"
135
+
136
+ # Current Settings: Glob, No Match case, Wrap around
137
+
138
+ Scenario: Should not match case if unset
139
+ When I replace the contents with "Foo\nBar\nBaz"
140
+ And I move the cursor to 0
141
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
142
+ And I choose "Plain" in the "query_type" field in the speedbar
143
+ And I type "foo" into the "Find" field in the speedbar
144
+ Then the selected text should be "Foo"
145
+
146
+ # Current Settings: Plain, No Match case, Wrap around
147
+
148
+ Scenario: Should not match case if unset with regex
149
+ When I replace the contents with "Foo\nBar\nBaz"
150
+ And I move the cursor to 0
151
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
152
+ And I choose "Regex" in the "query_type" field in the speedbar
153
+ And I type "fo." into the "Find" field in the speedbar
154
+ Then the selected text should be "Foo"
155
+
156
+ # Current Settings: Regex, No Match case, Wrap around
157
+
158
+ Scenario: Should not match case if unset with glob
159
+ When I replace the contents with "Foo\nBar\nBaz"
160
+ And I move the cursor to 0
161
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
162
+ And I choose "Glob" in the "query_type" field in the speedbar
163
+ And I type "fo*" into the "Find" field in the speedbar
164
+ Then the selected text should be "Foo"
165
+
166
+ # Current Settings: Glob, No Match case, Wrap around
167
+
168
+ Scenario: Should match case if requested
169
+ When I replace the contents with "Foo\nBar\nBaz"
170
+ And I move the cursor to 0
171
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
172
+ And I choose "Plain" in the "query_type" field in the speedbar
173
+ And I uncheck "Match case" in the speedbar
174
+ And I type "foo" into the "Find" field in the speedbar
175
+ Then the selected text should be "Foo"
176
+ When I check "Match case" in the speedbar
177
+ Then there should not be any text selected
178
+
179
+ # Current Settings: Plain, Match case, Wrap around
180
+
181
+ Scenario: Should match case if requested with regex
182
+ When I replace the contents with "Foo\nBar\nBaz"
183
+ And I move the cursor to 0
184
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
185
+ And I choose "Regex" in the "query_type" field in the speedbar
186
+ And I uncheck "Match case" in the speedbar
187
+ And I type "fo." into the "Find" field in the speedbar
188
+ Then the selected text should be "Foo"
189
+ When I check "Match case" in the speedbar
190
+ Then there should not be any text selected
191
+
192
+ # Current Settings: Regex, Match case, Wrap around
193
+
194
+ Scenario: Should match case if requested with glob
195
+ When I replace the contents with "Foo\nBar\nBaz"
196
+ And I move the cursor to 0
197
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
198
+ And I choose "Glob" in the "query_type" field in the speedbar
199
+ And I uncheck "Match case" in the speedbar
200
+ And I type "fo*" into the "Find" field in the speedbar
201
+ Then the selected text should be "Foo"
202
+ When I check "Match case" in the speedbar
203
+ Then there should not be any text selected
204
+
205
+ # Current Settings: Glob, Match case, Wrap around
206
+
207
+ Scenario: Reset settings
208
+ When I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
209
+ And I choose "Plain" in the "query_type" field in the speedbar
210
+ And I uncheck "Match case" in the speedbar
211
+ And I check "Wrap around" in the speedbar
212
+ Then "Plain" should be chosen in the "query_type" field in the speedbar
213
+ And "Match case" should not be checked in the speedbar
214
+ And "Wrap around" should be checked in the speedbar
215
+
216
+ # Current Settings: Plain, No Match case, Wrap around
217
+
218
+ Scenario: Find next with wrap around
219
+ When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
220
+ And I move the cursor to 0
221
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
222
+ And I type "Foo" into the "Find" field in the speedbar
223
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
224
+ And the selected text should be "Foo"
225
+ And the selection range should be from 0 to 3
226
+ When I press "Next" in the speedbar
227
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
228
+ And the selected text should be "Foo"
229
+ And the selection range should be from 8 to 11
230
+ When I press "Next" in the speedbar
231
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
232
+ And the selected text should be "Foo"
233
+ And the selection range should be from 0 to 3
234
+
235
+ Scenario: Find next without wrap around
236
+ When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
237
+ And I move the cursor to 0
238
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
239
+ And I uncheck "Wrap around" in the speedbar
240
+ And I type "Foo" into the "Find" field in the speedbar
241
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
242
+ And the selected text should be "Foo"
243
+ And the selection range should be from 0 to 3
244
+ When I press "Next" in the speedbar
245
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
246
+ And the selected text should be "Foo"
247
+ And the selection range should be from 8 to 11
248
+ When I press "Next" in the speedbar
249
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
250
+ And there should not be any text selected
251
+
252
+ # Current Settings: Plain, No Match case, No Wrap around
253
+
254
+ Scenario: Find previous with wrap around
255
+ When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
256
+ And I move the cursor to 18
257
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
258
+ And I type "Foo" into the "Find" field in the speedbar
259
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
260
+ And there should not be any text selected
261
+ When I press "Previous" in the speedbar
262
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
263
+ And the selected text should be "Foo"
264
+ And the selection range should be from 8 to 11
265
+ When I press "Previous" in the speedbar
266
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
267
+ And the selected text should be "Foo"
268
+ And the selection range should be from 0 to 3
269
+ When I check "Wrap around" in the speedbar
270
+ And I press "Previous" in the speedbar
271
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
272
+ And the selected text should be "Foo"
273
+ And the selection range should be from 8 to 11
274
+
275
+ # Current Settings: Plain, No Match case, Wrap around
276
+
277
+ Scenario: Find previous without wrap around
278
+ When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
279
+ And I move the cursor to 18
280
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
281
+ And I uncheck "Wrap around" in the speedbar
282
+ And I type "Foo" into the "Find" field in the speedbar
283
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
284
+ And there should not be any text selected
285
+ When I press "Previous" in the speedbar
286
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
287
+ And the selected text should be "Foo"
288
+ And the selection range should be from 8 to 11
289
+ When I press "Previous" in the speedbar
290
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
291
+ And the selected text should be "Foo"
292
+ And the selection range should be from 0 to 3
293
+ When I press "Previous" in the speedbar
294
+ Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
295
+ And there should not be any text selected
296
+
297
+ # Current Settings: Plain, No Match case, No Wrap around
298
+
299
+ Scenario: Should scroll vertically to the match
300
+ When I replace the contents with 100 lines of "xxx" then "Foo"
301
+ And I scroll to the top of the document
302
+ And I move the cursor to 0
303
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
304
+ And I type "Foo" into the "Find" field in the speedbar
305
+ Then the selected text should be "Foo"
306
+ And line number 100 should be visible
307
+
308
+ Scenario: "Should scroll horizontally to the match"
309
+ When I replace the contents with 300 "x" then "Foo"
310
+ And I move the cursor to 0
311
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
312
+ And I type "Foo" into the "Find" field in the speedbar
313
+ Then the selected text should be "Foo"
314
+ And horizontal offset 302 should be visible
315
+
316
+ Scenario: Should reopen with the same text as the previous search
317
+ When I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
318
+ And I type "foo" into the "Find" field in the speedbar
319
+ And I close the speedbar
320
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
321
+ Then the "Find" field in the speedbar should have text "foo"
322
+
323
+ Scenario: Should reopen with the same value of query type as the previous search
324
+ When I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
325
+ And I choose "Plain" in the "query_type" field in the speedbar
326
+ And I close the speedbar
327
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
328
+ Then "Plain" should be chosen in the "query_type" field in the speedbar
329
+ When I choose "Regex" in the "query_type" field in the speedbar
330
+ And I close the speedbar
331
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
332
+ Then "Regex" should be chosen in the "query_type" field in the speedbar
333
+ When I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
334
+ And I choose "Glob" in the "query_type" field in the speedbar
335
+ And I close the speedbar
336
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
337
+ Then "Glob" should be chosen in the "query_type" field in the speedbar
338
+
339
+ # Current Settings: Glob, Match case, Wrap around
340
+
341
+ Scenario: Should reopen with the same value of Match case as the previous search
342
+ When I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
343
+ And I check "Match case" in the speedbar
344
+ And I close the speedbar
345
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
346
+ Then "Match case" should be checked in the speedbar
347
+ When I uncheck "Match case" in the speedbar
348
+ And I close the speedbar
349
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
350
+ Then "Match case" should not be checked in the speedbar
351
+
352
+ # Current Settings: Glob, No Match case, Wrap around
353
+
354
+ Scenario: Should reopen with the same value of Wrap around as the previous search
355
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
356
+ And I check "Wrap around" in the speedbar
357
+ And I close the speedbar
358
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
359
+ Then "Wrap around" should be checked in the speedbar
360
+ When I uncheck "Wrap around" in the speedbar
361
+ And I close the speedbar
362
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
363
+ Then "Wrap around" should not be checked in the speedbar
364
+
365
+ # Current Settings: Glob, No Match case, Wrap around
366
+
367
+ Scenario: Should initialize query with the currently selected text
368
+ When I replace the contents with "Flux\nBar\nFoo"
369
+ And I move the cursor to 0
370
+ And I select from 0 to 4
371
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
372
+ Then the "Find" field in the speedbar should have text "Flux"
373
+
374
+ Scenario: Search for a word should start from the start of a selection
375
+ When I replace the contents with "Foo\nBar\nBaz"
376
+ And I select from 5 to 8
377
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
378
+ And I type "Ba" into the "Find" field in the speedbar
379
+ Then the selected text should be "Ba"
380
+ And the selection should be on line 2
381
+
382
+ Scenario: Should match the next occurence of the currently selected text
383
+ When I replace the contents with "Foo\nBar\nFoo"
384
+ And I move the cursor to 0
385
+ And I select from 0 to 3
386
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
387
+ And I press "Next" in the speedbar
388
+ Then the selected text should be "Foo"
389
+ And line number 2 should be visible
390
+
391
+ # End of scenarios copied from Find speedbar
392
+
393
+ # Begin of scenarios specific to Find and Replace speedbar
394
+
395
+ Scenario: Reset settings for Find and Replace
396
+ When I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
397
+ And I choose "Plain" in the "query_type" field in the speedbar
398
+ And I uncheck "Match case" in the speedbar
399
+ And I check "Wrap around" in the speedbar
400
+ Then "Plain" should be chosen in the "query_type" field in the speedbar
401
+ And "Match case" should not be checked in the speedbar
402
+ And "Wrap around" should be checked in the speedbar
403
+
404
+ # Current Settings: Plain, No Match case, Wrap around
405
+
406
+ Scenario: Open find and replace speedbar with initial selection
407
+ When I replace the contents with "Foo\nBar\nBaz"
408
+ And I select from 4 to 7
409
+ And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
410
+ Then the "Find" field in the speedbar should have text "Bar"
411
+ When I type "Foo" into the "Replace" field in the speedbar
412
+ And I press "Replace && Find" in the speedbar
413
+ Then the contents should be "Foo\nFoo\nBaz"
414
+ And there should not be any text selected
415
+
416
+ # Scenario: Find next with wrap around
417
+ # When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
418
+ # And I move the cursor to 0
419
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
420
+ # And I type "Foo" into the "Find" field in the speedbar
421
+ # And I choose "Plain" in the "query_type" field in the speedbar
422
+ # And I check "Wrap Around" in the speedbar
423
+ # And I press "Next" in the speedbar
424
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
425
+ # And the selected text should be "Foo"
426
+ # And the selection range should be from 0 to 3
427
+ # When I press "Next" in the speedbar
428
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
429
+ # And the selected text should be "Foo"
430
+ # And the selection range should be from 8 to 11
431
+ # When I press "Next" in the speedbar
432
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
433
+ # And the selected text should be "Foo"
434
+ # And the selection range should be from 0 to 3
435
+ #
436
+ # Scenario: Find next without wrap around
437
+ # When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
438
+ # And I move the cursor to 0
439
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
440
+ # And I type "Foo" into the "Find" field in the speedbar
441
+ # And I choose "Plain" in the "query_type" field in the speedbar
442
+ # And I uncheck "Wrap Around" in the speedbar
443
+ # And I press "Next" in the speedbar
444
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
445
+ # And the selected text should be "Foo"
446
+ # And the selection range should be from 0 to 3
447
+ # When I press "Next" in the speedbar
448
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
449
+ # And the selected text should be "Foo"
450
+ # And the selection range should be from 8 to 11
451
+ # When I press "Next" in the speedbar
452
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
453
+ # And the selected text should be ""
454
+ # And the selection range should be from 11 to 11
455
+ #
456
+ # Scenario: Find previous with wrap around
457
+ # When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
458
+ # And I move the cursor to 18
459
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
460
+ # And I type "Foo" into the "Find" field in the speedbar
461
+ # And I choose "Plain" in the "query_type" field in the speedbar
462
+ # And I check "Wrap Around" in the speedbar
463
+ # And I press "Previous" in the speedbar
464
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
465
+ # And the selected text should be "Foo"
466
+ # And the selection range should be from 8 to 11
467
+ # When I press "Previous" in the speedbar
468
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
469
+ # And the selected text should be "Foo"
470
+ # And the selection range should be from 0 to 3
471
+ # When I press "Previous" in the speedbar
472
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
473
+ # And the selected text should be "Foo"
474
+ # And the selection range should be from 8 to 11
475
+ #
476
+ # Scenario: Find previous without wrap around
477
+ # When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
478
+ # And I move the cursor to 18
479
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
480
+ # And I type "Foo" into the "Find" field in the speedbar
481
+ # And I choose "Plain" in the "query_type" field in the speedbar
482
+ # And I uncheck "Wrap Around" in the speedbar
483
+ # And I press "Previous" in the speedbar
484
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
485
+ # And the selected text should be "Foo"
486
+ # And the selection range should be from 8 to 11
487
+ # When I press "Previous" in the speedbar
488
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
489
+ # And the selected text should be "Foo"
490
+ # And the selection range should be from 0 to 3
491
+ # When I press "Previous" in the speedbar
492
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
493
+ # And the selected text should be ""
494
+ # And the selection range should be from 0 to 0
495
+ #
496
+ # Scenario: Find with regular expression
497
+ # When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
498
+ # And I move the cursor to 0
499
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
500
+ # And I type "Fo." into the "Find" field in the speedbar
501
+ # And I choose "Regex" in the "query_type" field in the speedbar
502
+ # And I check "Wrap Around" in the speedbar
503
+ # And I press "Next" in the speedbar
504
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
505
+ # And the selected text should be "Foo"
506
+ # And the selection range should be from 0 to 3
507
+ # When I press "Next" in the speedbar
508
+ # Then the contents should be "Foo\nBar Foo\nHmm\nBaz"
509
+ # And the selected text should be "Foo"
510
+ # And the selection range should be from 8 to 11
511
+ #
512
+ # Scenario: Replace and find with no initial selection
513
+ # When I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
514
+ # And I move the cursor to 0
515
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
516
+ # And I type "Rab" into the "Find" field in the speedbar
517
+ # And I type "RABBIT" into the "Replace" field in the speedbar
518
+ # And I choose "Plain" in the "query_type" field in the speedbar
519
+ # And I check "Wrap Around" in the speedbar
520
+ # And I press "Replace && Find" in the speedbar
521
+ # Then the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
522
+ # And the selected text should be "Rab"
523
+ # And the selection range should be from 12 to 15
524
+ # When I press "Replace && Find" in the speedbar
525
+ # Then the contents should be "Foo\nBar Foo RABBIT Rab\nHmm\nRab\nFoo\nBaz"
526
+ # And the selected text should be "Rab"
527
+ # And the selection range should be from 19 to 22
528
+ # When I press "Replace && Find" in the speedbar
529
+ # Then the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRab\nFoo\nBaz"
530
+ # And the selected text should be "Rab"
531
+ # And the selection range should be from 30 to 33
532
+ # When I press "Replace && Find" in the speedbar
533
+ # Then the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
534
+ # And the selected text should be "RAB"
535
+ # And the selection range should be from 12 to 15
536
+ # When I press "Replace && Find" in the speedbar
537
+ # Then the contents should be "Foo\nBar Foo RABBITBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
538
+ # And the selected text should be "RAB"
539
+ # And the selection range should be from 22 to 25
540
+ #
541
+ # Scenario: Replace and find with matching initial selection
542
+ # When I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
543
+ # And I select from 12 to 15
544
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
545
+ # And I type "Rab" into the "Find" field in the speedbar
546
+ # And I type "RABBIT" into the "Replace" field in the speedbar
547
+ # And I choose "Plain" in the "query_type" field in the speedbar
548
+ # And I check "Wrap Around" in the speedbar
549
+ # And I press "Replace && Find" in the speedbar
550
+ # Then the contents should be "Foo\nBar Foo RABBIT Rab\nHmm\nRab\nFoo\nBaz"
551
+ # And the selected text should be "Rab"
552
+ # And the selection range should be from 19 to 22
553
+ # When I press "Replace && Find" in the speedbar
554
+ # Then the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRab\nFoo\nBaz"
555
+ # And the selected text should be "Rab"
556
+ # And the selection range should be from 30 to 33
557
+ # When I press "Replace && Find" in the speedbar
558
+ # Then the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
559
+ # And the selected text should be "RAB"
560
+ # And the selection range should be from 12 to 15
561
+ # When I press "Replace && Find" in the speedbar
562
+ # Then the contents should be "Foo\nBar Foo RABBITBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
563
+ # And the selected text should be "RAB"
564
+ # And the selection range should be from 22 to 25
565
+ #
566
+ # Scenario: Replace and find with initial selection that doesn't match
567
+ # When I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
568
+ # And I select from 4 to 7
569
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
570
+ # And I type "Rab" into the "Find" field in the speedbar
571
+ # And I type "RABBIT" into the "Replace" field in the speedbar
572
+ # And I choose "Plain" in the "query_type" field in the speedbar
573
+ # And I check "Wrap Around" in the speedbar
574
+ # And I press "Replace && Find" in the speedbar
575
+ # Then the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
576
+ # And the selected text should be "Rab"
577
+ # And the selection range should be from 12 to 15
578
+ # When I press "Replace && Find" in the speedbar
579
+ # Then the contents should be "Foo\nBar Foo RABBIT Rab\nHmm\nRab\nFoo\nBaz"
580
+ # And the selected text should be "Rab"
581
+ # And the selection range should be from 19 to 22
582
+ # When I press "Replace && Find" in the speedbar
583
+ # Then the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRab\nFoo\nBaz"
584
+ # And the selected text should be "Rab"
585
+ # And the selection range should be from 30 to 33
586
+ # When I press "Replace && Find" in the speedbar
587
+ # Then the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
588
+ # And the selected text should be "RAB"
589
+ # And the selection range should be from 12 to 15
590
+ # When I press "Replace && Find" in the speedbar
591
+ # Then the contents should be "Foo\nBar Foo RABBITBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
592
+ # And the selected text should be "RAB"
593
+ # And the selection range should be from 22 to 25
594
+ #
595
+ # Scenario: Replace and find with initial selection that is after last match
596
+ # When I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
597
+ # And I select from 28 to 31
598
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
599
+ # And I type "Rab" into the "Find" field in the speedbar
600
+ # And I type "RABBIT" into the "Replace" field in the speedbar
601
+ # And I choose "Plain" in the "query_type" field in the speedbar
602
+ # And I check "Wrap Around" in the speedbar
603
+ # And I press "Replace && Find" in the speedbar
604
+ # Then the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
605
+ # And the selected text should be "Rab"
606
+ # And the selection range should be from 12 to 15
607
+ # When I press "Replace && Find" in the speedbar
608
+ # Then the contents should be "Foo\nBar Foo RABBIT Rab\nHmm\nRab\nFoo\nBaz"
609
+ # And the selected text should be "Rab"
610
+ # And the selection range should be from 19 to 22
611
+ # When I press "Replace && Find" in the speedbar
612
+ # Then the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRab\nFoo\nBaz"
613
+ # And the selected text should be "Rab"
614
+ # And the selection range should be from 30 to 33
615
+ # When I press "Replace && Find" in the speedbar
616
+ # Then the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
617
+ # And the selected text should be "RAB"
618
+ # And the selection range should be from 12 to 15
619
+ # When I press "Replace && Find" in the speedbar
620
+ # Then the contents should be "Foo\nBar Foo RABBITBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
621
+ # And the selected text should be "RAB"
622
+ # And the selection range should be from 22 to 25
623
+ #
624
+ # Scenario: Replace and find with initial selection that is after last match and no wrap around
625
+ # When I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
626
+ # And I select from 28 to 31
627
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
628
+ # And I type "Rab" into the "Find" field in the speedbar
629
+ # And I type "RABBIT" into the "Replace" field in the speedbar
630
+ # And I choose "Plain" in the "query_type" field in the speedbar
631
+ # And I uncheck "Wrap Around" in the speedbar
632
+ # And I press "Replace && Find" in the speedbar
633
+ # Then the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
634
+ # And the selected text should be ""
635
+ # And the selection range should be from 31 to 31
636
+ # When I press "Replace && Find" in the speedbar
637
+ # Then the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
638
+ # And the selected text should be ""
639
+ # And the selection range should be from 31 to 31
640
+ #
641
+ # Scenario: Replace all replaces one
642
+ # When I replace the contents with "Foo\nBar\nBaz"
643
+ # And I move the cursor to 0
644
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
645
+ # And I type "Bar" into the "Find" field in the speedbar
646
+ # And I type "Rab" into the "Replace" field in the speedbar
647
+ # And I choose "Plain" in the "query_type" field in the speedbar
648
+ # And I uncheck "Wrap Around" in the speedbar
649
+ # And I press "Replace All" in the speedbar
650
+ # Then the contents should be "Foo\nRab\nBaz"
651
+ # And the selected text should be "Rab"
652
+ # And the selection range should be from 4 to 7
653
+ #
654
+ # Scenario: Replace all replaces two
655
+ # When I replace the contents with "Foo\nBar\nBaz\nBar\nQux"
656
+ # And I move the cursor to 0
657
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
658
+ # And I type "Bar" into the "Find" field in the speedbar
659
+ # And I type "Rab" into the "Replace" field in the speedbar
660
+ # And I choose "Plain" in the "query_type" field in the speedbar
661
+ # And I uncheck "Wrap Around" in the speedbar
662
+ # And I press "Replace All" in the speedbar
663
+ # Then the contents should be "Foo\nRab\nBaz\nRab\nQux"
664
+ # And the selected text should be "Rab"
665
+ # And the selection range should be from 12 to 15
666
+ #
667
+ # Scenario: Replace all replaces two on the same line
668
+ # When I replace the contents with "abcabc"
669
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
670
+ # And I type "bc" into the "Find" field in the speedbar
671
+ # And I type "xx" into the "Replace" field in the speedbar
672
+ # And I choose "Plain" in the "query_type" field in the speedbar
673
+ # And I uncheck "Wrap Around" in the speedbar
674
+ # And I press "Replace All" in the speedbar
675
+ # Then the contents should be "axxaxx"
676
+ # And the selected text should be "xx"
677
+ # And the selection range should be from 4 to 6
678
+ # When I press "Replace All" in the speedbar
679
+ # Then the contents should be "axxaxx"
680
+ # And the selected text should be "xx"
681
+ # And the selection range should be from 4 to 6
682
+ #
683
+ # Scenario: Replace all replaces overlapping occurences on the same line
684
+ # When I replace the contents with "deedeedeed"
685
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
686
+ # And I type "deed" into the "Find" field in the speedbar
687
+ # And I type "misdeed" into the "Replace" field in the speedbar
688
+ # And I choose "Plain" in the "query_type" field in the speedbar
689
+ # And I uncheck "Wrap Around" in the speedbar
690
+ # And I press "Replace All" in the speedbar
691
+ # Then the contents should be "misdeedeemisdeed"
692
+ # And the selected text should be "misdeed"
693
+ # And the selection range should be from 9 to 16
694
+ #
695
+ # Scenario: Replace all is a single undo action
696
+ # When I replace the contents with "Foo\n\nabcabc\n\nBar"
697
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
698
+ # And I type "bc" into the "Find" field in the speedbar
699
+ # And I type "xx" into the "Replace" field in the speedbar
700
+ # And I choose "Plain" in the "query_type" field in the speedbar
701
+ # And I uncheck "Wrap Around" in the speedbar
702
+ # And I press "Replace All" in the speedbar
703
+ # Then the contents should be "Foo\n\naxxaxx\n\nBar"
704
+ # And the selected text should be "xx"
705
+ # And the selection range should be from 9 to 11
706
+ # When I undo
707
+ # Then the contents should be "Foo\n\nabcabc\n\nBar"
708
+ #
709
+ # Scenario: Replace all regex with back-references
710
+ # When I replace the contents with "One fish\ntwo fish\nred fish\nblue fish"
711
+ # And I move the cursor to 0
712
+ # And I run the command DocumentSearch::FindAndReplaceSpeedbarCommand
713
+ # And I type "(\w+) fish" into the "Find" field in the speedbar
714
+ # And I type "\1 car" into the "Replace" field in the speedbar
715
+ # And I choose "Regex" in the "query_type" field in the speedbar
716
+ # And I uncheck "Wrap Around" in the speedbar
717
+ # And I press "Replace All" in the speedbar
718
+ # Then the contents should be "One car\ntwo car\nred car\nblue car"
719
+ # And the selected text should be "blue car"
720
+ # And the selection range should be from 24 to 32
721
+
722
+ # TODO: Scenarios with match case
723
+ # TODO: Scenarios with glob search type