redcar 0.3.7.1 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +16 -0
- data/README.md +5 -0
- data/ROADMAP.md +7 -9
- data/Rakefile +55 -22
- data/lib/redcar.rb +12 -6
- data/lib/redcar/installer.rb +119 -44
- data/plugins/application/features/step_definitions/speedbar_steps.rb +62 -0
- data/plugins/application/features/step_definitions/tree_steps.rb +3 -3
- data/plugins/application/features/support/env.rb +2 -1
- data/plugins/application/lib/application/notebook.rb +53 -7
- data/plugins/application/lib/application/speedbar.rb +12 -0
- data/plugins/application/lib/application/tab.rb +16 -5
- data/plugins/application/lib/application/treebook.rb +21 -1
- data/plugins/application_swt/lib/application_swt.rb +12 -2
- data/plugins/application_swt/lib/application_swt/html_tab.rb +4 -0
- data/plugins/application_swt/lib/application_swt/notebook.rb +5 -3
- data/plugins/application_swt/lib/application_swt/speedbar.rb +15 -27
- data/plugins/application_swt/lib/application_swt/swt_wrapper.rb +1 -0
- data/plugins/application_swt/lib/application_swt/tab.rb +1 -0
- data/plugins/application_swt/lib/application_swt/treebook.rb +36 -8
- data/plugins/application_swt/lib/application_swt/window.rb +24 -18
- data/plugins/auto_completer/lib/auto_completer.rb +5 -20
- data/plugins/core/lib/core.rb +7 -4
- data/plugins/core/lib/core/observable_struct.rb +2 -2
- data/plugins/declarations/lib/declarations.rb +3 -17
- data/plugins/document_search/features/search.feature +163 -0
- data/plugins/document_search/features/support/env.rb +4 -0
- data/plugins/document_search/lib/document_search.rb +121 -0
- data/plugins/document_search/plugin.rb +8 -0
- data/plugins/edit_view/features/line_delimiter.feature +7 -0
- data/plugins/edit_view/features/step_definitions/editing_steps.rb +49 -1
- data/plugins/edit_view/features/step_definitions/tab_steps.rb +10 -11
- data/plugins/edit_view/features/switch_tabs.feature +61 -10
- data/plugins/edit_view/lib/edit_view.rb +4 -0
- data/plugins/edit_view/lib/edit_view/document.rb +56 -0
- data/plugins/edit_view/lib/edit_view/document/command.rb +1 -1
- data/plugins/edit_view/lib/edit_view/edit_tab.rb +0 -8
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +4 -0
- data/plugins/html_view/lib/html_controller.rb +19 -1
- data/plugins/html_view/lib/html_view.rb +28 -1
- data/plugins/html_view/lib/html_view/html_tab.rb +10 -1
- data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +3 -1
- data/plugins/project/features/open_directory_tree.feature +3 -3
- data/plugins/project/lib/project.rb +4 -6
- data/plugins/project/lib/project/commands.rb +17 -0
- data/plugins/project/lib/project/dir_controller.rb +2 -1
- data/plugins/project/lib/project/dir_mirror.rb +8 -0
- data/plugins/project/lib/project/manager.rb +2 -0
- data/plugins/project/plugin.rb +2 -1
- data/plugins/project/vendor/net-sftp/Manifest +55 -0
- data/plugins/project/vendor/net-sftp/Rakefile +30 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp.rb +70 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/constants.rb +187 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/errors.rb +39 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/dir.rb +93 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/download.rb +364 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/file.rb +176 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/file_factory.rb +60 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/upload.rb +387 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/packet.rb +21 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol.rb +32 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/attributes.rb +315 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/base.rb +268 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/name.rb +43 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/02/base.rb +31 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/03/base.rb +35 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/attributes.rb +152 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/base.rb +94 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/name.rb +67 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/05/base.rb +66 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/06/attributes.rb +107 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/06/base.rb +63 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/base.rb +50 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/request.rb +91 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/response.rb +76 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/session.rb +951 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/version.rb +18 -0
- data/plugins/project/vendor/net-sftp/setup.rb +1331 -0
- data/plugins/project/vendor/net-sftp/test/common.rb +171 -0
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_attributes.rb +97 -0
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_base.rb +210 -0
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_name.rb +27 -0
- data/plugins/project/vendor/net-sftp/test/protocol/02/test_base.rb +26 -0
- data/plugins/project/vendor/net-sftp/test/protocol/03/test_base.rb +27 -0
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_attributes.rb +148 -0
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_base.rb +74 -0
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_name.rb +53 -0
- data/plugins/project/vendor/net-sftp/test/protocol/05/test_base.rb +62 -0
- data/plugins/project/vendor/net-sftp/test/protocol/06/test_attributes.rb +124 -0
- data/plugins/project/vendor/net-sftp/test/protocol/06/test_base.rb +51 -0
- data/plugins/project/vendor/net-sftp/test/protocol/test_base.rb +42 -0
- data/plugins/project/vendor/net-sftp/test/test_all.rb +7 -0
- data/plugins/project/vendor/net-sftp/test/test_dir.rb +47 -0
- data/plugins/project/vendor/net-sftp/test/test_download.rb +252 -0
- data/plugins/project/vendor/net-sftp/test/test_file.rb +159 -0
- data/plugins/project/vendor/net-sftp/test/test_file_factory.rb +48 -0
- data/plugins/project/vendor/net-sftp/test/test_packet.rb +9 -0
- data/plugins/project/vendor/net-sftp/test/test_protocol.rb +17 -0
- data/plugins/project/vendor/net-sftp/test/test_request.rb +71 -0
- data/plugins/project/vendor/net-sftp/test/test_response.rb +53 -0
- data/plugins/project/vendor/net-sftp/test/test_session.rb +741 -0
- data/plugins/project/vendor/net-sftp/test/test_upload.rb +219 -0
- data/plugins/project/vendor/net-ssh/Manifest +110 -0
- data/plugins/project/vendor/net-ssh/Rakefile +85 -0
- data/plugins/project/vendor/net-ssh/Rudyfile +96 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh.rb +215 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/agent.rb +179 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/constants.rb +18 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/key_manager.rb +193 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/abstract.rb +60 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/hostbased.rb +71 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/keyboard_interactive.rb +66 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/password.rb +39 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/publickey.rb +92 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/pageant.rb +183 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/session.rb +134 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/buffer.rb +340 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/buffered_io.rb +198 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/config.rb +202 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/channel.rb +630 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/constants.rb +33 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/session.rb +597 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/term.rb +178 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/errors.rb +85 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/key_factory.rb +102 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/known_hosts.rb +129 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/loggable.rb +61 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/packet.rb +102 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/prompt.rb +93 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/command.rb +75 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/errors.rb +14 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/http.rb +94 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/socks4.rb +70 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/socks5.rb +142 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/ruby_compat.rb +43 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/service/forward.rb +288 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test.rb +89 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/channel.rb +129 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/extensions.rb +152 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/kex.rb +44 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/local_packet.rb +51 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/packet.rb +81 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/remote_packet.rb +38 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/script.rb +157 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/socket.rb +64 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/algorithms.rb +384 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/cipher_factory.rb +97 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/constants.rb +30 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac.rb +31 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/abstract.rb +79 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/md5.rb +12 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/none.rb +15 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/sha1.rb +13 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/identity_cipher.rb +55 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex.rb +13 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +208 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +77 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/openssl.rb +128 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/packet_stream.rb +235 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/server_version.rb +71 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/session.rb +276 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/state.rb +206 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/lenient.rb +30 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/null.rb +12 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/strict.rb +53 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/version.rb +62 -0
- data/plugins/project/vendor/net-ssh/net-ssh.gemspec +138 -0
- data/plugins/project/vendor/net-ssh/setup.rb +1585 -0
- data/plugins/project/vendor/net-ssh/support/arcfour_check.rb +20 -0
- data/plugins/project/vendor/net-ssh/support/ssh_tunnel_bug.rb +65 -0
- data/plugins/project/vendor/net-ssh/test/README.txt +42 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/common.rb +28 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_abstract.rb +51 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_hostbased.rb +114 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_keyboard_interactive.rb +98 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_password.rb +50 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_publickey.rb +127 -0
- data/plugins/project/vendor/net-ssh/test/authentication/test_agent.rb +205 -0
- data/plugins/project/vendor/net-ssh/test/authentication/test_key_manager.rb +105 -0
- data/plugins/project/vendor/net-ssh/test/authentication/test_session.rb +93 -0
- data/plugins/project/vendor/net-ssh/test/common.rb +107 -0
- data/plugins/project/vendor/net-ssh/test/configs/eqsign +3 -0
- data/plugins/project/vendor/net-ssh/test/configs/exact_match +8 -0
- data/plugins/project/vendor/net-ssh/test/configs/host_plus +10 -0
- data/plugins/project/vendor/net-ssh/test/configs/multihost +4 -0
- data/plugins/project/vendor/net-ssh/test/configs/nohost +19 -0
- data/plugins/project/vendor/net-ssh/test/configs/numeric_host +4 -0
- data/plugins/project/vendor/net-ssh/test/configs/wild_cards +14 -0
- data/plugins/project/vendor/net-ssh/test/connection/test_channel.rb +467 -0
- data/plugins/project/vendor/net-ssh/test/connection/test_session.rb +488 -0
- data/plugins/project/vendor/net-ssh/test/manual/test_forward.rb +185 -0
- data/plugins/project/vendor/net-ssh/test/test_all.rb +9 -0
- data/plugins/project/vendor/net-ssh/test/test_buffer.rb +336 -0
- data/plugins/project/vendor/net-ssh/test/test_buffered_io.rb +63 -0
- data/plugins/project/vendor/net-ssh/test/test_config.rb +117 -0
- data/plugins/project/vendor/net-ssh/test/test_key_factory.rb +67 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_md5.rb +39 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_md5_96.rb +25 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_none.rb +34 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_sha1.rb +34 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_sha1_96.rb +25 -0
- data/plugins/project/vendor/net-ssh/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
- data/plugins/project/vendor/net-ssh/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_algorithms.rb +302 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_cipher_factory.rb +213 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_hmac.rb +34 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_identity_cipher.rb +40 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_packet_stream.rb +441 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_server_version.rb +78 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_session.rb +315 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_state.rb +173 -0
- data/plugins/redcar/plugin.rb +3 -1
- data/plugins/redcar/redcar.rb +108 -121
- data/plugins/redcar_debug/lib/redcar_debug.rb +2 -0
- data/plugins/runnables/lib/runnables.rb +80 -23
- data/plugins/runnables/lib/runnables/command_output_controller.rb +102 -0
- data/plugins/runnables/lib/runnables/running_process_checker.rb +34 -0
- data/plugins/runnables/{plugin_no_load.rb → plugin.rb} +2 -1
- data/plugins/runnables/vendor/session-2.4.0/HISTORY +73 -0
- data/plugins/runnables/vendor/session-2.4.0/README +89 -0
- data/plugins/runnables/vendor/session-2.4.0/TODO +3 -0
- data/plugins/runnables/vendor/session-2.4.0/VERSION +1 -0
- data/plugins/runnables/vendor/session-2.4.0/gemspec.rb +22 -0
- data/plugins/runnables/vendor/session-2.4.0/install.rb +143 -0
- data/plugins/runnables/vendor/session-2.4.0/lib/session.rb +757 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/bash.rb +60 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/driver.rb +47 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/session_idl.rb +25 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/session_sh.rb +29 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/sh0.rb +23 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/stdin.rb +17 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/threadtest.rb +42 -0
- data/plugins/runnables/vendor/session-2.4.0/session-2.4.0.gem +0 -0
- data/plugins/runnables/vendor/session-2.4.0/test/session.rb +227 -0
- data/plugins/runnables/views/command_output.html.erb +32 -0
- data/plugins/task_manager/lib/task_manager.rb +2 -0
- data/plugins/textmate/lib/textmate/plist.rb +1 -1
- data/plugins/textmate/lib/textmate/snippet.rb +1 -0
- data/plugins/tree/lib/tree/mirror.rb +8 -1
- data/plugins/tree_view_swt/lib/tree_view_swt.rb +29 -2
- metadata +191 -6
- data/plugins/declarations/TODO +0 -3
- data/plugins/redcar/spec/redcar/redcar_spec.rb +0 -70
- data/plugins/redcar/spec/spec_helper.rb +0 -4
@@ -37,4 +37,11 @@ Feature: Line delimiter
|
|
37
37
|
And I move the cursor to 4
|
38
38
|
And I press the Backspace key in the edit tab
|
39
39
|
Then the contents should be "foobar\nbaz\n"
|
40
|
+
|
41
|
+
Scenario: End goes to end of line (Windows)
|
42
|
+
When I open a new edit tab
|
43
|
+
And I replace the contents with "foo\r\nbar\r\nbaz\r\n"
|
44
|
+
And I move the cursor to 0
|
45
|
+
And I run the command Redcar::Top::MoveEndCommand
|
46
|
+
Then the cursor should be at 3
|
40
47
|
|
@@ -132,7 +132,25 @@ Then /^the selection range should be from (\d+) to (\d+)$/ do |from_str, to_str|
|
|
132
132
|
r.begin.should == from_str.to_i
|
133
133
|
r.end.should == to_str.to_i
|
134
134
|
end
|
135
|
+
|
136
|
+
Then /^the selection should be on line (.*)$/ do |line_num|
|
137
|
+
line_num = line_num.to_i
|
138
|
+
doc = Redcar::EditView.focussed_edit_view_document
|
139
|
+
r = doc.selection_range
|
140
|
+
doc.line_at_offset(r.begin).should == line_num
|
141
|
+
doc.line_at_offset(r.end).should == line_num
|
142
|
+
end
|
135
143
|
|
144
|
+
Then /^there should not be any text selected$/ do
|
145
|
+
doc = Redcar::EditView.focussed_edit_view_document
|
146
|
+
doc.selected_text.should == ""
|
147
|
+
end
|
148
|
+
|
149
|
+
Then /^the selected text should be "([^"]*)"$/ do |selected_text|
|
150
|
+
doc = Redcar::EditView.focussed_edit_view_document
|
151
|
+
doc.selected_text.should == selected_text
|
152
|
+
end
|
153
|
+
|
136
154
|
Then /the line delimiter should be "(.*)"/ do |delim|
|
137
155
|
doc = Redcar::EditView.focussed_edit_view_document
|
138
156
|
doc.delim.should == unescape_text(delim)
|
@@ -148,4 +166,34 @@ Then /^the cursor should be on line (\d+)$/ do |num|
|
|
148
166
|
doc.cursor_line.should == num.to_i
|
149
167
|
end
|
150
168
|
|
151
|
-
|
169
|
+
When /^I replace the contents with "([^\"]*)"$/ do |contents|
|
170
|
+
contents = unescape_text(contents)
|
171
|
+
doc = Redcar::EditView.focussed_edit_view_document
|
172
|
+
cursor_offset = (contents =~ /<c>/)
|
173
|
+
contents = contents.gsub("<c>", "")
|
174
|
+
doc.text = contents
|
175
|
+
doc.cursor_offset = cursor_offset
|
176
|
+
end
|
177
|
+
|
178
|
+
When /^I replace the contents with 100 lines of "([^"]*)" then "([^"]*)"$/ do |contents1, contents2|
|
179
|
+
contents1 = unescape_text(contents1)
|
180
|
+
contents2 = unescape_text(contents2)
|
181
|
+
doc = Redcar::EditView.focussed_edit_view_document
|
182
|
+
doc.text = (contents1 + "\n")*100 + contents2
|
183
|
+
end
|
184
|
+
|
185
|
+
When /^I scroll to the top of the document$/ do
|
186
|
+
doc = Redcar::EditView.focussed_edit_view_document
|
187
|
+
doc.scroll_to_line(0)
|
188
|
+
end
|
189
|
+
|
190
|
+
Then /^line number (\d+) should be visible$/ do |line_num|
|
191
|
+
line_num = line_num.to_i
|
192
|
+
doc = Redcar::EditView.focussed_edit_view_document
|
193
|
+
(doc.biggest_visible_line >= line_num).should be_true
|
194
|
+
(doc.smallest_visible_line <= line_num).should be_true
|
195
|
+
end
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
@@ -18,22 +18,21 @@ When /^I close the focussed tab$/ do
|
|
18
18
|
Redcar::Top::CloseTabCommand.new.run
|
19
19
|
end
|
20
20
|
|
21
|
-
When
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
tab.edit_view.document.cursor_offset = cursor_offset
|
21
|
+
When /I switch (up|down) a tab/ do |type|
|
22
|
+
case type
|
23
|
+
when "down"
|
24
|
+
Redcar::Top::SwitchTabDownCommand.new.run
|
25
|
+
when "up"
|
26
|
+
Redcar::Top::SwitchTabUpCommand.new.run
|
27
|
+
end
|
29
28
|
end
|
30
29
|
|
31
30
|
When /I move (up|down) a tab/ do |type|
|
32
31
|
case type
|
33
32
|
when "down"
|
34
|
-
Redcar::Top::
|
33
|
+
Redcar::Top::MoveTabDownCommand.new.run
|
35
34
|
when "up"
|
36
|
-
Redcar::Top::
|
35
|
+
Redcar::Top::MoveTabUpCommand.new.run
|
37
36
|
end
|
38
37
|
end
|
39
38
|
|
@@ -45,7 +44,7 @@ Then /^there should be (one|\d+) (.*) tabs?$/ do |num, tab_type|
|
|
45
44
|
end
|
46
45
|
|
47
46
|
# in the model
|
48
|
-
tabs = Redcar.app.
|
47
|
+
tabs = Redcar.app.focussed_window.notebooks.map {|nb| nb.tabs }.flatten
|
49
48
|
tabs.length.should == num
|
50
49
|
|
51
50
|
# in the GUI
|
@@ -6,18 +6,18 @@ Feature: Switch and move tabs within a notebook
|
|
6
6
|
And I open a new edit tab
|
7
7
|
And I replace the contents with "Elizabeth Woodville"
|
8
8
|
Then I should see "Elizabeth Woodville" in the edit tab
|
9
|
-
And I
|
9
|
+
And I switch down a tab
|
10
10
|
Then I should see "Anne Boleyn" in the edit tab
|
11
11
|
|
12
|
-
Scenario:
|
12
|
+
Scenario: Switching tabs down will wrap
|
13
13
|
When I open a new edit tab
|
14
14
|
And I replace the contents with "Anne Boleyn"
|
15
15
|
And I open a new edit tab
|
16
16
|
And I replace the contents with "Elizabeth Woodville"
|
17
17
|
Then I should see "Elizabeth Woodville" in the edit tab
|
18
|
-
And I
|
19
|
-
And I
|
20
|
-
Then I should see "
|
18
|
+
And I switch down a tab
|
19
|
+
And I switch down a tab
|
20
|
+
Then I should see "Elizabeth Woodville" in the edit tab
|
21
21
|
|
22
22
|
Scenario: Switch tab up
|
23
23
|
When I open a new edit tab
|
@@ -25,18 +25,18 @@ Feature: Switch and move tabs within a notebook
|
|
25
25
|
And I open a new edit tab
|
26
26
|
And I replace the contents with "Elizabeth Woodville"
|
27
27
|
Then I should see "Elizabeth Woodville" in the edit tab
|
28
|
-
And I
|
29
|
-
And I
|
28
|
+
And I switch down a tab
|
29
|
+
And I switch up a tab
|
30
30
|
Then I should see "Elizabeth Woodville" in the edit tab
|
31
31
|
|
32
|
-
Scenario:
|
32
|
+
Scenario: Switching tabs up will wrap
|
33
33
|
When I open a new edit tab
|
34
34
|
And I replace the contents with "Anne Boleyn"
|
35
35
|
And I open a new edit tab
|
36
36
|
And I replace the contents with "Elizabeth Woodville"
|
37
37
|
Then I should see "Elizabeth Woodville" in the edit tab
|
38
|
-
And I
|
39
|
-
Then I should see "
|
38
|
+
And I switch up a tab
|
39
|
+
Then I should see "Anne Boleyn" in the edit tab
|
40
40
|
|
41
41
|
Scenario: Switch notebooks
|
42
42
|
When I open a new edit tab
|
@@ -48,8 +48,59 @@ Feature: Switch and move tabs within a notebook
|
|
48
48
|
When I switch notebooks
|
49
49
|
Then I should see "Anne Boleyn" in the edit tab
|
50
50
|
|
51
|
+
Scenario: Move tab up
|
52
|
+
When I open a new edit tab
|
53
|
+
And I replace the contents with "Anne Boleyn"
|
54
|
+
And I open a new edit tab
|
55
|
+
And I replace the contents with "Elizabeth Woodville"
|
56
|
+
Then I should see "Elizabeth Woodville" in the edit tab
|
57
|
+
And I switch down a tab
|
58
|
+
Then I should see "Anne Boleyn" in the edit tab
|
59
|
+
And I move up a tab
|
60
|
+
Then I should see "Anne Boleyn" in the edit tab
|
61
|
+
And I switch down a tab
|
62
|
+
Then I should see "Elizabeth Woodville" in the edit tab
|
63
|
+
|
51
64
|
|
65
|
+
Scenario: Moving tabs up will wrap
|
66
|
+
When I open a new edit tab
|
67
|
+
And I replace the contents with "Anne Boleyn"
|
68
|
+
And I open a new edit tab
|
69
|
+
And I replace the contents with "Elizabeth Woodville"
|
70
|
+
And I open a new edit tab
|
71
|
+
And I replace the contents with "Catherine of Aragon"
|
72
|
+
Then I should see "Catherine of Aragon" in the edit tab
|
73
|
+
And I move up a tab
|
74
|
+
And I move up a tab
|
75
|
+
And I move up a tab
|
76
|
+
And I move up a tab
|
77
|
+
And I switch up a tab
|
78
|
+
Then I should see "Anne Boleyn" in the edit tab
|
52
79
|
|
80
|
+
Scenario: Move tab down
|
81
|
+
When I open a new edit tab
|
82
|
+
And I replace the contents with "Anne Boleyn"
|
83
|
+
And I open a new edit tab
|
84
|
+
And I replace the contents with "Elizabeth Woodville"
|
85
|
+
Then I should see "Elizabeth Woodville" in the edit tab
|
86
|
+
And I move down a tab
|
87
|
+
Then I should see "Elizabeth Woodville" in the edit tab
|
88
|
+
And I switch up a tab
|
89
|
+
Then I should see "Anne Boleyn" in the edit tab
|
53
90
|
|
91
|
+
Scenario: Moving tabs down will wrap
|
92
|
+
When I open a new edit tab
|
93
|
+
And I replace the contents with "Anne Boleyn"
|
94
|
+
And I open a new edit tab
|
95
|
+
And I replace the contents with "Elizabeth Woodville"
|
96
|
+
And I open a new edit tab
|
97
|
+
And I replace the contents with "Catherine of Aragon"
|
98
|
+
Then I should see "Catherine of Aragon" in the edit tab
|
99
|
+
And I move down a tab
|
100
|
+
And I move down a tab
|
101
|
+
And I move down a tab
|
102
|
+
And I move down a tab
|
103
|
+
And I switch down a tab
|
104
|
+
Then I should see "Anne Boleyn" in the edit tab
|
54
105
|
|
55
106
|
|
@@ -8,6 +8,8 @@ module Redcar
|
|
8
8
|
include Redcar::Observable
|
9
9
|
extend Forwardable
|
10
10
|
|
11
|
+
WORDCHARS = /\w|_/
|
12
|
+
|
11
13
|
def self.all_document_controller_types
|
12
14
|
result = []
|
13
15
|
Redcar.plugin_manager.objects_implementing(:document_controller_types).each do |object|
|
@@ -71,6 +73,10 @@ module Redcar
|
|
71
73
|
end
|
72
74
|
end
|
73
75
|
|
76
|
+
def exists?
|
77
|
+
edit_view.exists?
|
78
|
+
end
|
79
|
+
|
74
80
|
def mirror=(new_mirror)
|
75
81
|
notify_listeners(:new_mirror, new_mirror) do
|
76
82
|
@mirror = new_mirror
|
@@ -278,6 +284,54 @@ module Redcar
|
|
278
284
|
end
|
279
285
|
end
|
280
286
|
|
287
|
+
# The word at an offset.
|
288
|
+
#
|
289
|
+
# @param [Integer] an offset
|
290
|
+
# @return [String] the text of the word
|
291
|
+
def word_at_offset(offset)
|
292
|
+
range = word_range_at_offset(offset)
|
293
|
+
get_range(range.first, range.last - range.first)
|
294
|
+
end
|
295
|
+
|
296
|
+
# The word found at the current cursor offset.
|
297
|
+
#
|
298
|
+
# @return [String] the text of the word
|
299
|
+
def current_word
|
300
|
+
word_at_offset(cursor_offset)
|
301
|
+
end
|
302
|
+
|
303
|
+
# The range of the word at an offset.
|
304
|
+
#
|
305
|
+
# @param [Integer] an offset
|
306
|
+
# @return [Range<Integer>] a range between two character offsets
|
307
|
+
def word_range_at_offset(offset)
|
308
|
+
line_index = line_at_offset(offset)
|
309
|
+
line_start_offset = offset_at_line(line_index)
|
310
|
+
line_chars = get_line(line_index)
|
311
|
+
left_range = 0
|
312
|
+
right_range = 0
|
313
|
+
left = offset - line_start_offset - 1
|
314
|
+
right = offset - line_start_offset
|
315
|
+
|
316
|
+
until left == -1 || (line_chars[left].chr !~ WORDCHARS)
|
317
|
+
left -= 1
|
318
|
+
left_range -= 1
|
319
|
+
end
|
320
|
+
|
321
|
+
until right == length || (line_chars[right].chr !~ WORDCHARS)
|
322
|
+
right += 1
|
323
|
+
right_range += 1
|
324
|
+
end
|
325
|
+
(offset + left_range..offset + right_range)
|
326
|
+
end
|
327
|
+
|
328
|
+
# The range of the word at the current cursor position.
|
329
|
+
#
|
330
|
+
# @return [Range<Integer>] a range between two character offsets
|
331
|
+
def current_word_range
|
332
|
+
word_range_at_offset(cursor_offset)
|
333
|
+
end
|
334
|
+
|
281
335
|
# The range of text selected by the user.
|
282
336
|
#
|
283
337
|
# @return [Range<Integer>] a range between two character offsets
|
@@ -321,10 +375,12 @@ module Redcar
|
|
321
375
|
get_range(selection_range.begin, selection_range.count)
|
322
376
|
end
|
323
377
|
|
378
|
+
# Is the document in block selection mode.
|
324
379
|
def block_selection_mode?
|
325
380
|
controller.block_selection_mode?
|
326
381
|
end
|
327
382
|
|
383
|
+
# Turn the block selection mode on or off.
|
328
384
|
def block_selection_mode=(boolean)
|
329
385
|
controller.block_selection_mode = !!boolean
|
330
386
|
end
|
@@ -219,6 +219,10 @@ module Redcar
|
|
219
219
|
focus_control = ApplicationSWT.display.get_focus_control
|
220
220
|
focus_control == @mate_text.get_control
|
221
221
|
end
|
222
|
+
|
223
|
+
def exists?
|
224
|
+
@mate_text.get_control and !@mate_text.get_control.disposed
|
225
|
+
end
|
222
226
|
|
223
227
|
def attach_listeners
|
224
228
|
# h = @document.add_listener(:set_text, &method(:reparse))
|
@@ -1,5 +1,23 @@
|
|
1
1
|
|
2
2
|
module Redcar
|
3
|
-
|
3
|
+
module HtmlController
|
4
|
+
include Redcar::Observable
|
5
|
+
|
6
|
+
# Override this to return a message if the user should be prompted
|
7
|
+
# before closing the tab.
|
8
|
+
def ask_before_closing
|
9
|
+
nil
|
10
|
+
end
|
11
|
+
|
12
|
+
# Override this to run code right before the tab is closed.
|
13
|
+
def close
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
# Call execute with a string of javascript to execute the script
|
18
|
+
# in the context of the browser widget.
|
19
|
+
def execute(script)
|
20
|
+
notify_listeners(:execute_script, script)
|
21
|
+
end
|
4
22
|
end
|
5
23
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
2
|
require 'html_view/html_tab'
|
3
|
+
require 'html_controller'
|
3
4
|
|
4
5
|
module Redcar
|
5
6
|
class HtmlView
|
@@ -24,6 +25,28 @@ module Redcar
|
|
24
25
|
func = RubyFunc.new(@html_tab.controller.browser, "rubyCall")
|
25
26
|
func.controller = @controller
|
26
27
|
controller_action("index")
|
28
|
+
attach_controller_listeners
|
29
|
+
end
|
30
|
+
|
31
|
+
def attach_controller_listeners
|
32
|
+
@controller.add_listener(:execute_script) do |script|
|
33
|
+
begin
|
34
|
+
Redcar.update_gui do
|
35
|
+
begin
|
36
|
+
browser = @html_tab.controller.browser
|
37
|
+
unless browser.is_disposed
|
38
|
+
browser.execute(script)
|
39
|
+
end
|
40
|
+
rescue => e
|
41
|
+
puts e.message
|
42
|
+
puts e.backtrace
|
43
|
+
end
|
44
|
+
end
|
45
|
+
rescue => e
|
46
|
+
puts e.message
|
47
|
+
puts e.backtrace
|
48
|
+
end
|
49
|
+
end
|
27
50
|
end
|
28
51
|
|
29
52
|
def controller_action(action_name, params=nil)
|
@@ -58,7 +81,11 @@ module Redcar
|
|
58
81
|
def function(args)
|
59
82
|
func_name = args.to_a.first
|
60
83
|
func_args = args.to_a.last.to_a
|
61
|
-
|
84
|
+
begin
|
85
|
+
JSON(controller.send(func_name.to_sym, *func_args))
|
86
|
+
rescue JSON::GeneratorError => e
|
87
|
+
nil
|
88
|
+
end
|
62
89
|
end
|
63
90
|
|
64
91
|
attr_accessor :controller
|
@@ -9,6 +9,11 @@ module Redcar
|
|
9
9
|
create_html_view
|
10
10
|
end
|
11
11
|
|
12
|
+
def close
|
13
|
+
html_view.controller.close if html_view.controller
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
12
17
|
def create_html_view
|
13
18
|
@html_view = HtmlView.new(self)
|
14
19
|
end
|
@@ -16,5 +21,9 @@ module Redcar
|
|
16
21
|
def controller_action(action, params)
|
17
22
|
notify_listeners(:controller_action, action, params)
|
18
23
|
end
|
24
|
+
|
25
|
+
def go_to_location(url)
|
26
|
+
controller.go_to_location(url)
|
27
|
+
end
|
19
28
|
end
|
20
|
-
end
|
29
|
+
end
|