redcar 0.10 → 0.11.0dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/CHANGES +14 -0
  2. data/Rakefile +68 -29
  3. data/lib/redcar.rb +2 -2
  4. data/plugins/application/lib/application/dialogs/filter_list_dialog.rb +2 -1
  5. data/plugins/application_swt/spec/application_swt/gradient_spec.rb +3 -12
  6. data/plugins/core/lib/core/resource.rb +13 -5
  7. data/plugins/document_search/features/find.feature +366 -214
  8. data/plugins/document_search/features/incremental_search.feature +351 -0
  9. data/plugins/document_search/features/replace.feature +16 -16
  10. data/plugins/document_search/features/step_definitions/find_steps.rb +16 -0
  11. data/plugins/document_search/features/support/env.rb +11 -0
  12. data/plugins/document_search/lib/document_search.rb +149 -109
  13. data/plugins/document_search/lib/document_search/commands.rb +251 -202
  14. data/plugins/document_search/lib/document_search/find_speedbar.rb +138 -81
  15. data/plugins/document_search/lib/document_search/incremental_search_speedbar.rb +70 -0
  16. data/plugins/document_search/lib/document_search/query_options.rb +15 -39
  17. data/plugins/document_search/plugin.rb +1 -1
  18. data/plugins/edit_view/features/step_definitions/editing_steps.rb +6 -2
  19. data/plugins/edit_view_swt/lib/edit_view_swt.rb +2 -2
  20. data/plugins/file_parser/lib/file_parser.rb +6 -1
  21. data/plugins/html_view/features/step_definitions/web_view_steps.rb +12 -0
  22. data/plugins/html_view/features/support/env.rb +16 -0
  23. data/plugins/html_view/lib/html_view.rb +5 -1
  24. data/plugins/line_tools/lib/line_tools.rb +16 -0
  25. data/plugins/project/features/find_file.feature +28 -0
  26. data/plugins/project/features/open_and_save_files.feature +11 -0
  27. data/plugins/project/features/step_definitions/file_steps.rb +6 -1
  28. data/plugins/project/features/support/env.rb +2 -0
  29. data/plugins/project/lib/project.rb +49 -6
  30. data/plugins/project/lib/project/commands.rb +18 -6
  31. data/plugins/project/lib/project/find_file_dialog.rb +19 -8
  32. data/plugins/project/lib/project/find_recent_dialog.rb +30 -0
  33. data/plugins/project/lib/project/manager.rb +41 -10
  34. data/plugins/project/lib/project/recent.rb +64 -0
  35. data/plugins/project/spec/fixtures/myproject/vendor/bar.rb +0 -0
  36. data/plugins/project/spec/fixtures/myproject/vendor/plugins/bar.rb +0 -0
  37. data/plugins/{find-in-project → project_search}/TODO.md +3 -3
  38. data/plugins/project_search/features/support/env.rb +6 -0
  39. data/plugins/project_search/features/word_search.feature +34 -0
  40. data/plugins/project_search/lib/project_search.rb +73 -0
  41. data/plugins/project_search/lib/project_search/binary_data_detector.rb +46 -0
  42. data/plugins/project_search/lib/project_search/commands.rb +62 -0
  43. data/plugins/project_search/lib/project_search/hit.rb +17 -0
  44. data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/images/collapsed.png +0 -0
  45. data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/images/expanded.png +0 -0
  46. data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/images/spinner.gif +0 -0
  47. data/plugins/project_search/lib/project_search/lucene_index.rb +64 -0
  48. data/plugins/project_search/lib/project_search/lucene_refresh.rb +22 -0
  49. data/plugins/project_search/lib/project_search/project.rb +14 -0
  50. data/plugins/project_search/lib/project_search/query.rb +29 -0
  51. data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/stylesheets/style.css +14 -3
  52. data/plugins/project_search/lib/project_search/views/_file.html.erb +60 -0
  53. data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/views/index.html.erb +12 -9
  54. data/plugins/project_search/lib/project_search/word_search.rb +105 -0
  55. data/plugins/project_search/lib/project_search/word_search_controller.rb +207 -0
  56. data/plugins/project_search/plugin.rb +8 -0
  57. data/plugins/project_search/spec/fixtures/project/binary_file.bin +0 -0
  58. data/plugins/project_search/spec/fixtures/project/foo.txt +43 -0
  59. data/plugins/project_search/spec/fixtures/project/qux.rb +3 -0
  60. data/plugins/project_search/spec/project_search/binary_data_detector_spec.rb +24 -0
  61. data/plugins/project_search/spec/project_search/word_search_spec.rb +157 -0
  62. data/plugins/project_search/spec/spec_helper.rb +27 -0
  63. data/plugins/redcar/redcar.rb +77 -71
  64. data/plugins/ruby/lib/ruby/syntax_checker.rb +1 -1
  65. data/plugins/snippets/features/snippets.feature +12 -0
  66. data/plugins/snippets/lib/snippets/tab_handler.rb +1 -1
  67. metadata +46 -25
  68. data/plugins/document_search/features/find_and_replace.feature +0 -723
  69. data/plugins/document_search/lib/document_search/find_and_replace_speedbar.rb +0 -142
  70. data/plugins/find-in-project/lib/find_in_project.rb +0 -35
  71. data/plugins/find-in-project/lib/find_in_project/commands.rb +0 -30
  72. data/plugins/find-in-project/lib/find_in_project/controllers.rb +0 -170
  73. data/plugins/find-in-project/lib/find_in_project/views/_divider.html.erb +0 -4
  74. data/plugins/find-in-project/lib/find_in_project/views/_file_heading.html.erb +0 -10
  75. data/plugins/find-in-project/lib/find_in_project/views/_file_line.html.erb +0 -6
  76. data/plugins/find-in-project/plugin.rb +0 -11
  77. data/plugins/project/lib/project/recent_directories.rb +0 -54
@@ -3,7 +3,7 @@ require 'java'
3
3
  module Redcar
4
4
  class Ruby
5
5
  class SyntaxChecker < Redcar::SyntaxCheck::Checker
6
- supported_grammars "Ruby", "Ruby on Rails"
6
+ supported_grammars "Ruby", "Ruby on Rails", "RSpec"
7
7
 
8
8
  def check(*args)
9
9
  path = manifest_path(doc)
@@ -189,6 +189,18 @@ Feature: Snippets
189
189
  And I press the Tab key in the edit tab
190
190
  Then the contents should be "ABC Felix 4 Gaeta"
191
191
 
192
+ Scenario: Does not trigger snippet on tab trigger with trailing space
193
+ Given there is a snippet with tab trigger "if" and scope "text.plain" and content
194
+ """
195
+ if ${1:condition}\n\t$0\nend
196
+ """
197
+ When I replace the contents with "ABC if <c>"
198
+ And I press the Tab key in the edit tab
199
+ And I move the cursor to 0
200
+ And I press the Tab key in the edit tab
201
+ Then the contents should not be "\t<c>ABC if condition\n\t\nend"
202
+ And the contents should be "\t<c>ABC if \t"
203
+
192
204
  Scenario: Leaves snippet on cursor move
193
205
  Given there is a snippet with tab trigger "if" and scope "text.plain" and content
194
206
  """
@@ -84,7 +84,7 @@ module Redcar
84
84
  def self.word_before_cursor(edit_view)
85
85
  document = edit_view.document
86
86
  line = document.get_slice(document.cursor_line_start_offset, document.cursor_offset).reverse
87
- if line =~ /([\S]+)(\s|$|\.)/
87
+ if !line.empty? && !(line[0].chr =~ /\s/) && line =~ /([\S]+)(\s|$|\.)/
88
88
  word = $1.reverse
89
89
  end
90
90
  word
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redcar
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease: false
4
+ hash: -364798509
5
+ prerelease: true
6
6
  segments:
7
7
  - 0
8
- - 10
9
- version: "0.10"
8
+ - 11
9
+ - 0dev
10
+ version: 0.11.0dev
10
11
  platform: ruby
11
12
  authors:
12
13
  - Daniel Lucraft
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-01-17 00:00:00 +00:00
18
+ date: 2011-01-28 00:00:00 +00:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -3829,12 +3830,13 @@ files:
3829
3830
  - plugins/declarations/spec/fixtures/federalist.rb
3830
3831
  - plugins/declarations/spec/spec_helper.rb
3831
3832
  - plugins/document_search/features/find.feature
3832
- - plugins/document_search/features/find_and_replace.feature
3833
+ - plugins/document_search/features/incremental_search.feature
3833
3834
  - plugins/document_search/features/replace.feature
3835
+ - plugins/document_search/features/step_definitions/find_steps.rb
3834
3836
  - plugins/document_search/features/support/env.rb
3835
3837
  - plugins/document_search/lib/document_search/commands.rb
3836
- - plugins/document_search/lib/document_search/find_and_replace_speedbar.rb
3837
3838
  - plugins/document_search/lib/document_search/find_speedbar.rb
3839
+ - plugins/document_search/lib/document_search/incremental_search_speedbar.rb
3838
3840
  - plugins/document_search/lib/document_search/query_options.rb
3839
3841
  - plugins/document_search/lib/document_search.rb
3840
3842
  - plugins/document_search/plugin.rb
@@ -3908,19 +3910,6 @@ files:
3908
3910
  - plugins/execute_current_tab/plugin.rb
3909
3911
  - plugins/file_parser/lib/file_parser.rb
3910
3912
  - plugins/file_parser/plugin.rb
3911
- - plugins/find-in-project/lib/find_in_project/commands.rb
3912
- - plugins/find-in-project/lib/find_in_project/controllers.rb
3913
- - plugins/find-in-project/lib/find_in_project/images/collapsed.png
3914
- - plugins/find-in-project/lib/find_in_project/images/expanded.png
3915
- - plugins/find-in-project/lib/find_in_project/images/spinner.gif
3916
- - plugins/find-in-project/lib/find_in_project/stylesheets/style.css
3917
- - plugins/find-in-project/lib/find_in_project/views/_divider.html.erb
3918
- - plugins/find-in-project/lib/find_in_project/views/_file_heading.html.erb
3919
- - plugins/find-in-project/lib/find_in_project/views/_file_line.html.erb
3920
- - plugins/find-in-project/lib/find_in_project/views/index.html.erb
3921
- - plugins/find-in-project/lib/find_in_project.rb
3922
- - plugins/find-in-project/plugin.rb
3923
- - plugins/find-in-project/TODO.md
3924
3913
  - plugins/groovy/features/fixtures/test.groovy
3925
3914
  - plugins/groovy/features/step_definitions/groovy_steps.rb
3926
3915
  - plugins/groovy/features/support/env.rb
@@ -3956,6 +3945,7 @@ files:
3956
3945
  - plugins/html_view/features/fixtures/other.html
3957
3946
  - plugins/html_view/features/fixtures/sample.html
3958
3947
  - plugins/html_view/features/step_definitions/html_view_steps.rb
3948
+ - plugins/html_view/features/step_definitions/web_view_steps.rb
3959
3949
  - plugins/html_view/features/support/env.rb
3960
3950
  - plugins/html_view/features/web_preview.feature
3961
3951
  - plugins/html_view/lib/html_controller.rb
@@ -4068,9 +4058,10 @@ files:
4068
4058
  - plugins/project/lib/project/file_list.rb
4069
4059
  - plugins/project/lib/project/file_mirror.rb
4070
4060
  - plugins/project/lib/project/find_file_dialog.rb
4061
+ - plugins/project/lib/project/find_recent_dialog.rb
4071
4062
  - plugins/project/lib/project/manager.rb
4072
4063
  - plugins/project/lib/project/project_tree_controller.rb
4073
- - plugins/project/lib/project/recent_directories.rb
4064
+ - plugins/project/lib/project/recent.rb
4074
4065
  - plugins/project/lib/project/sub_project.rb
4075
4066
  - plugins/project/lib/project/support/recycle.js
4076
4067
  - plugins/project/lib/project/support/trash.rb
@@ -4079,6 +4070,8 @@ files:
4079
4070
  - plugins/project/spec/fixtures/myproject/lib/foo_lib.rb
4080
4071
  - plugins/project/spec/fixtures/myproject/README
4081
4072
  - plugins/project/spec/fixtures/myproject/spec/foo_spec.rb
4073
+ - plugins/project/spec/fixtures/myproject/vendor/bar.rb
4074
+ - plugins/project/spec/fixtures/myproject/vendor/plugins/bar.rb
4082
4075
  - plugins/project/spec/fixtures/winter.txt
4083
4076
  - plugins/project/spec/project/adapters/remote_protocols/ftp_spec.rb
4084
4077
  - plugins/project/spec/project/adapters/remote_protocols/sftp_spec.rb
@@ -4269,6 +4262,32 @@ files:
4269
4262
  - plugins/project/vendor/net-ssh/test/transport/test_state.rb
4270
4263
  - plugins/project/vendor/net-ssh/THANKS.rdoc
4271
4264
  - plugins/project/views/bulk_rename.html.erb
4265
+ - plugins/project_search/features/support/env.rb
4266
+ - plugins/project_search/features/word_search.feature
4267
+ - plugins/project_search/lib/project_search/binary_data_detector.rb
4268
+ - plugins/project_search/lib/project_search/commands.rb
4269
+ - plugins/project_search/lib/project_search/hit.rb
4270
+ - plugins/project_search/lib/project_search/images/collapsed.png
4271
+ - plugins/project_search/lib/project_search/images/expanded.png
4272
+ - plugins/project_search/lib/project_search/images/spinner.gif
4273
+ - plugins/project_search/lib/project_search/lucene_index.rb
4274
+ - plugins/project_search/lib/project_search/lucene_refresh.rb
4275
+ - plugins/project_search/lib/project_search/project.rb
4276
+ - plugins/project_search/lib/project_search/query.rb
4277
+ - plugins/project_search/lib/project_search/stylesheets/style.css
4278
+ - plugins/project_search/lib/project_search/views/_file.html.erb
4279
+ - plugins/project_search/lib/project_search/views/index.html.erb
4280
+ - plugins/project_search/lib/project_search/word_search.rb
4281
+ - plugins/project_search/lib/project_search/word_search_controller.rb
4282
+ - plugins/project_search/lib/project_search.rb
4283
+ - plugins/project_search/plugin.rb
4284
+ - plugins/project_search/spec/fixtures/project/binary_file.bin
4285
+ - plugins/project_search/spec/fixtures/project/foo.txt
4286
+ - plugins/project_search/spec/fixtures/project/qux.rb
4287
+ - plugins/project_search/spec/project_search/binary_data_detector_spec.rb
4288
+ - plugins/project_search/spec/project_search/word_search_spec.rb
4289
+ - plugins/project_search/spec/spec_helper.rb
4290
+ - plugins/project_search/TODO.md
4272
4291
  - plugins/project_search/vendor/lucene/CHANGELOG
4273
4292
  - plugins/project_search/vendor/lucene/CONTRIBUTORS
4274
4293
  - plugins/project_search/vendor/lucene/examples/active_model/serializers.rb
@@ -7051,12 +7070,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
7051
7070
  required_rubygems_version: !ruby/object:Gem::Requirement
7052
7071
  none: false
7053
7072
  requirements:
7054
- - - ">="
7073
+ - - ">"
7055
7074
  - !ruby/object:Gem::Version
7056
- hash: 3
7075
+ hash: 25
7057
7076
  segments:
7058
- - 0
7059
- version: "0"
7077
+ - 1
7078
+ - 3
7079
+ - 1
7080
+ version: 1.3.1
7060
7081
  requirements: []
7061
7082
 
7062
7083
  rubyforge_project:
@@ -1,723 +0,0 @@
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