redcar 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +28 -0
- data/README.md +7 -0
- data/ROADMAP.md +11 -1
- data/Rakefile +61 -2
- data/bin/redcar +2 -1
- data/lib/redcar.rb +4 -3
- data/lib/redcar/installer.rb +3 -1
- data/lib/redcar/runner.rb +1 -1
- data/lib/redcar/usage.rb +4 -7
- data/lib/redcar_quick_start.rb +39 -5
- data/plugins/application/features/step_definitions/tree_steps.rb +6 -0
- data/plugins/application/features/support/env.rb +2 -6
- data/plugins/application/icons/redcar_icon_beta_dev.png +0 -0
- data/plugins/application/lib/application/command/executor.rb +8 -0
- data/plugins/application/lib/application/dialog.rb +25 -2
- data/plugins/application/lib/application/notebook.rb +4 -0
- data/plugins/application/lib/application/window.rb +4 -0
- data/plugins/application_swt/lib/application_swt.rb +2 -0
- data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +28 -1
- data/plugins/application_swt/lib/application_swt/menu.rb +4 -0
- data/plugins/application_swt/lib/application_swt/menu/binding_translator.rb +4 -0
- data/plugins/application_swt/lib/application_swt/notebook.rb +22 -1
- data/plugins/application_swt/lib/application_swt/notebook/tab_drag_and_drop_listener.rb +124 -0
- data/plugins/application_swt/lib/application_swt/notebook/tab_transfer.rb +83 -0
- data/plugins/application_swt/lib/application_swt/swt_wrapper.rb +14 -0
- data/plugins/application_swt/lib/application_swt/tab.rb +28 -6
- data/plugins/application_swt/lib/application_swt/window.rb +88 -43
- data/plugins/application_swt/spec/application_swt/menu/binding_translator_spec.rb +11 -0
- data/plugins/application_swt/spec/spec_helper.rb +1 -1
- data/plugins/auto_completer/lib/auto_completer.rb +3 -20
- data/plugins/auto_pairer/lib/auto_pairer/document_controller.rb +1 -1
- data/plugins/declarations/lib/declarations/parser.rb +2 -2
- data/plugins/declarations/spec/spec_helper.rb +1 -0
- data/plugins/edit_view/features/step_definitions/notebook_steps.rb +3 -3
- data/plugins/edit_view/features/step_definitions/window_steps.rb +24 -9
- data/plugins/edit_view/features/support/env.rb +11 -9
- data/plugins/edit_view/lib/edit_view.rb +106 -6
- data/plugins/edit_view/lib/edit_view/info_speedbar.rb +32 -3
- data/plugins/edit_view/lib/edit_view/select_font_dialog.rb +39 -0
- data/plugins/edit_view/lib/edit_view/select_theme_dialog.rb +34 -0
- data/plugins/edit_view/lib/edit_view/tab_settings.rb +103 -8
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +40 -3
- data/plugins/edit_view_swt/lib/edit_view_swt/edit_tab.rb +1 -1
- data/plugins/execute_current_tab/lib/execute_current_tab.rb +15 -6
- data/plugins/project/features/open_directory_tree.feature +10 -0
- data/plugins/project/lib/project.rb +10 -8
- data/plugins/project/lib/project/dir_mirror.rb +6 -5
- data/plugins/project/lib/project/drb_service.rb +16 -0
- data/plugins/project/lib/project/manager.rb +31 -5
- data/plugins/redcar/redcar.rb +115 -19
- data/plugins/tree_view_swt/lib/tree_view_swt.rb +15 -0
- data/textmate/Bundles/Cucumber.tmbundle/Preferences/Cucumber_Plain_Text_Feature_Completions.tmPreferences +3 -3
- data/textmate/Bundles/Cucumber.tmbundle/Preferences/Symbol_list___Scenario.tmPreferences +1 -1
- data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Plain_Text_Feature.tmLanguage +18 -76
- data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Steps.tmLanguage +1 -1
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/Animation_animateStyle.tmSnippet +23 -0
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/Event_listen.tmSnippet +16 -0
- data/textmate/Bundles/{Cucumber.tmbundle/Snippets/When_Step_Plaintext.tmSnippet → Palm-WebOS-Development.tmbundle/Snippets/Event_stop.tmSnippet} +5 -5
- data/textmate/Bundles/{Cucumber.tmbundle/Snippets/Then_Step.tmSnippet → Palm-WebOS-Development.tmbundle/Snippets/Event_stopListening.tmSnippet} +5 -9
- data/textmate/Bundles/{Cucumber.tmbundle/Snippets/Cucumber_Multiline_Steps.tmSnippet → Palm-WebOS-Development.tmbundle/Snippets/List_Model.tmSnippet} +10 -7
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/Log_addLoggingMethodsToPrototype.tmSnippet +16 -0
- data/textmate/Bundles/{Cucumber.tmbundle/Snippets/Then_Step_Plaintext.tmSnippet → Palm-WebOS-Development.tmbundle/Snippets/Log_info.tmSnippet} +5 -5
- data/textmate/Bundles/{Cucumber.tmbundle/Snippets/Scenario___heading_only__.tmSnippet → Palm-WebOS-Development.tmbundle/Snippets/Log_logProperties.tmSnippet} +5 -7
- data/textmate/Bundles/{Cucumber.tmbundle/Snippets/When_Step.tmSnippet → Palm-WebOS-Development.tmbundle/Snippets/Model.tmSnippet} +7 -9
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/__L____.tmSnippet +16 -0
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/_insert____.tmSnippet +16 -0
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/_update____.tmSnippet +16 -0
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/controller_get.tmSnippet +16 -0
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/controller_pushScene.tmSnippet +16 -0
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Snippets/controller_serviceRequest.tmSnippet +21 -0
- data/textmate/Bundles/{Cucumber.tmbundle/Snippets/Scenario_Outline.tmSnippet → Palm-WebOS-Development.tmbundle/Snippets/controller_setupWidget.tmSnippet} +5 -9
- data/textmate/Bundles/{Cucumber.tmbundle/Snippets/Given_Step.tmSnippet → Palm-WebOS-Development.tmbundle/Snippets/controller_showBanner.tmSnippet} +5 -9
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/Syntaxes/Mojo.tmLanguage +713 -0
- data/textmate/Bundles/Palm-WebOS-Development.tmbundle/info.plist +188 -0
- data/textmate/Bundles/Smalltalk.tmbundle/Preferences/GNU_Smalltalk.tmPreferences +32 -0
- data/textmate/Bundles/{asciidoc.tmbundle/Preferences/Symbol_List___Heading.tmPreferences → Smalltalk.tmbundle/Preferences/GNU___Symbol_List___Method.tmPreferences} +7 -6
- data/textmate/Bundles/{Cucumber.tmbundle/Preferences/next_Symbol_list___Scenario.tmPreferences → Smalltalk.tmbundle/Preferences/GNU___Symbol_List___Section.tmPreferences} +7 -4
- data/textmate/Bundles/{asciidoc.tmbundle/Snippets/Bold.tmSnippet → Smalltalk.tmbundle/Preferences/MIST_Smalltalk_Format.tmPreferences} +8 -7
- data/textmate/Bundles/Smalltalk.tmbundle/Syntaxes/GNU_Smalltalk.tmLanguage +493 -0
- data/textmate/Bundles/Smalltalk.tmbundle/Syntaxes/GNU_Smalltalk_2.tmLanguage +807 -0
- data/textmate/Bundles/Smalltalk.tmbundle/Syntaxes/MIST_Smalltalk_Format.tmLanguage +645 -0
- data/textmate/Bundles/Smalltalk.tmbundle/info.plist +21 -0
- data/textmate/Themes/Twilight.tmTheme +4 -0
- metadata +2604 -2586
- data/textmate/Bundles/Cucumber.tmbundle/Preferences/next_Cucumber_Plain_Text_Feature_Completions.tmPreferences +0 -30
- data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/next_Cucumber_Plain_Text_Feature.tmLanguage +0 -221
- data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/next_Cucumber_Steps.tmLanguage +0 -424
- data/textmate/Bundles/asciidoc.tmbundle/Preferences/Typing_Pairs___Defaults.tmPreferences +0 -54
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Anchor.tmSnippet +0 -16
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Comment_Block.tmSnippet +0 -19
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Example_Block.tmSnippet +0 -19
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Italic.tmSnippet +0 -16
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Listing_Block.tmSnippet +0 -20
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Literal_Block.tmSnippet +0 -19
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Passthrough_Block.tmSnippet +0 -19
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Quote_Block.tmSnippet +0 -19
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Quoted.tmSnippet +0 -16
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Sidebar_Block.tmSnippet +0 -19
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Subscript.tmSnippet +0 -16
- data/textmate/Bundles/asciidoc.tmbundle/Snippets/Superscript.tmSnippet +0 -16
- data/textmate/Bundles/asciidoc.tmbundle/Syntaxes/AsciiDoc.tmLanguage +0 -428
- data/textmate/Bundles/asciidoc.tmbundle/info.plist +0 -91
@@ -42,6 +42,17 @@ describe BindingTranslator do
|
|
42
42
|
check("Tab", Swt::SWT::TAB)
|
43
43
|
end
|
44
44
|
|
45
|
+
it "translates home" do
|
46
|
+
check("Home", Swt::SWT::HOME)
|
47
|
+
check("Alt+Home", Swt::SWT::ALT + Swt::SWT::HOME)
|
48
|
+
check("Shift+Home", Swt::SWT::SHIFT + Swt::SWT::HOME)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "translates end" do
|
52
|
+
check("End", Swt::SWT::END)
|
53
|
+
check("Ctrl+End", Swt::SWT::CTRL + Swt::SWT::END)
|
54
|
+
check("Cmd+End", Swt::SWT::COMMAND + Swt::SWT::END)
|
55
|
+
end
|
45
56
|
end
|
46
57
|
|
47
58
|
describe "multiple modifiers" do
|
@@ -1,14 +1,4 @@
|
|
1
1
|
|
2
|
-
module Redcar
|
3
|
-
class ApplicationSWT
|
4
|
-
class Menu
|
5
|
-
def move(x, y)
|
6
|
-
@menu_bar.setLocation(x, y)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
2
|
require 'auto_completer/current_document_completion_source'
|
13
3
|
require 'auto_completer/document_controller'
|
14
4
|
require 'auto_completer/word_iterator'
|
@@ -144,18 +134,11 @@ module Redcar
|
|
144
134
|
end
|
145
135
|
end
|
146
136
|
|
147
|
-
|
148
|
-
location = window.focussed_notebook.focussed_tab.controller.edit_view.mate_text.viewer.getTextWidget.getLocationAtOffset(window.focussed_notebook.focussed_tab.controller.edit_view.cursor_offset)
|
149
|
-
absolute_x = location.x
|
150
|
-
absolute_y = location.y
|
151
|
-
location = window.focussed_notebook.focussed_tab.controller.edit_view.mate_text.viewer.getTextWidget.toDisplay(0,0)
|
152
|
-
absolute_x += location.x
|
153
|
-
absolute_y += location.y
|
154
|
-
menu = ApplicationSWT::Menu.new(window.controller, builder.menu, nil, Swt::SWT::POP_UP)
|
155
|
-
menu.move(absolute_x, absolute_y)
|
156
|
-
menu.show
|
137
|
+
Application::Dialog.popup_menu(builder.menu, :cursor)
|
157
138
|
end
|
158
139
|
end
|
159
140
|
end
|
160
141
|
end
|
161
142
|
end
|
143
|
+
|
144
|
+
|
@@ -71,7 +71,7 @@ module Redcar
|
|
71
71
|
# Type over ends
|
72
72
|
if @rules = PairsForScope.pairs_for_scope(cursor_scope)
|
73
73
|
inverse_rules = @rules.invert
|
74
|
-
if
|
74
|
+
if !@ignore_insert
|
75
75
|
end_mark_pair = find_mark_pair_by_end(start_offset)
|
76
76
|
if end_mark_pair and end_mark_pair.text == text
|
77
77
|
@type_over_end = true
|
@@ -16,7 +16,7 @@ module Redcar
|
|
16
16
|
- regex: "^[^#]*(class|module)\\s+(?:\\w*::)*(\\w+)(?:$|\\s|<)"
|
17
17
|
capture: 2
|
18
18
|
type: id
|
19
|
-
- regex: "^[^#]*def (self\\.)?(\\w+)"
|
19
|
+
- regex: "^[^#]*def (self\\.)?(\\w+[?!]?)"
|
20
20
|
capture: 2
|
21
21
|
type: id
|
22
22
|
- regex: "^[^#]*attr(_reader|_accessor|_writer)(.*)$"
|
@@ -25,7 +25,7 @@ module Redcar
|
|
25
25
|
- regex: "^[^#]*alias\s+:(\\w+)"
|
26
26
|
capture: 1
|
27
27
|
type: id
|
28
|
-
- regex: "^[^#]*alias_method\s+:(\\w+)"
|
28
|
+
- regex: "^[^#]*alias_method\s+:(\\w+[?!]?)"
|
29
29
|
capture: 1
|
30
30
|
type: id
|
31
31
|
- regex: "^\\s*([A-Z]\\w*)\\s*="
|
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
2
|
module NotebookSwtHelper
|
3
|
-
def
|
4
|
-
|
3
|
+
def notebook_sash
|
4
|
+
active_shell.children.to_a.last.children.to_a[0]
|
5
5
|
end
|
6
6
|
|
7
7
|
def ctab_folders
|
8
|
-
|
8
|
+
notebook_sash.children.to_a.select do |c|
|
9
9
|
c.class == Java::OrgEclipseSwtCustom::CTabFolder
|
10
10
|
end
|
11
11
|
end
|
@@ -26,7 +26,23 @@ When /I open a new window(?: with title "(.*)")?/ do |title|
|
|
26
26
|
end
|
27
27
|
|
28
28
|
class FakeEvent
|
29
|
-
|
29
|
+
def initialize(event_type, widget)
|
30
|
+
untyped_event = Swt::Widgets::Event.new.tap do |e|
|
31
|
+
e.display = Swt.display
|
32
|
+
e.widget = widget
|
33
|
+
e.x = 0
|
34
|
+
e.y = 0
|
35
|
+
end
|
36
|
+
widget.notify_listeners(event_type, untyped_event)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
When /^I maximize the window size$/ do
|
41
|
+
Redcar.app.focussed_window.controller.shell.maximized = true
|
42
|
+
end
|
43
|
+
|
44
|
+
When /^I restore the window size$/ do
|
45
|
+
Redcar.app.focussed_window.controller.shell.maximized = false
|
30
46
|
end
|
31
47
|
|
32
48
|
When /I close the window(?: "(.*)")?( with a command| through the gui)?/ do |title, how|
|
@@ -43,8 +59,8 @@ When /I close the window(?: "(.*)")?( with a command| through the gui)?/ do |tit
|
|
43
59
|
shell = display.get_active_shell
|
44
60
|
win = Redcar.app.windows.detect {|w| w.controller.shell == shell }
|
45
61
|
end
|
46
|
-
win.controller.
|
47
|
-
end
|
62
|
+
FakeEvent.new(Swt::SWT::Close, win.controller.shell)
|
63
|
+
end
|
48
64
|
end
|
49
65
|
|
50
66
|
When /^I focus the window "([^\"]*)" with a command$/ do |title|
|
@@ -54,7 +70,7 @@ end
|
|
54
70
|
|
55
71
|
When /^I focus the window "([^\"]*)" through the gui$/ do |title|
|
56
72
|
win = Redcar.app.windows.detect{|win| win.title == title }
|
57
|
-
win.controller.
|
73
|
+
FakeEvent.new(Swt::SWT::Activate, win.controller.shell)
|
58
74
|
end
|
59
75
|
|
60
76
|
Then /^the window should be titled "([^\"]*)"$/ do |title|
|
@@ -75,10 +91,9 @@ Then /the window "(.*)" should have (\d+) tabs?/ do |win_title, tab_num|
|
|
75
91
|
|
76
92
|
# in the GUI
|
77
93
|
display = Swt::Widgets::Display.get_current
|
78
|
-
shells
|
79
|
-
shell
|
80
|
-
|
81
|
-
|
82
|
-
items = tab_folders.map{|f| f.getItems.to_a}.flatten
|
94
|
+
shells = display.get_shells.to_a
|
95
|
+
shell = shells.detect {|s| s.text == win_title }
|
96
|
+
items = get_tab_folders(shell).map{|f| f.getItems.to_a}.flatten
|
97
|
+
|
83
98
|
items.map {|i| model_tab_for_item(i)}.length.should == tab_num
|
84
99
|
end
|
@@ -1,12 +1,17 @@
|
|
1
1
|
RequireSupportFiles File.dirname(__FILE__) + "/../../../application/features/"
|
2
2
|
|
3
3
|
module SwtTabHelpers
|
4
|
+
def get_tab_folders(shell=active_shell)
|
5
|
+
right_composite = shell.children.to_a.last
|
6
|
+
notebook_sash_form = right_composite.children.to_a[0]
|
7
|
+
tab_folders = notebook_sash_form.children.to_a.select do |c|
|
8
|
+
c.class == Java::OrgEclipseSwtCustom::CTabFolder
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
4
12
|
def get_tab_folder
|
5
|
-
|
6
|
-
|
7
|
-
tab_folders = sash_form.children.to_a[1].children.to_a[0].children.to_a
|
8
|
-
tab_folders.length.should == 1
|
9
|
-
tab_folders.first
|
13
|
+
get_tab_folders.length.should == 1
|
14
|
+
get_tab_folders.first
|
10
15
|
end
|
11
16
|
|
12
17
|
def get_tab(tab_folder)
|
@@ -19,10 +24,7 @@ module SwtTabHelpers
|
|
19
24
|
end
|
20
25
|
|
21
26
|
def get_tabs
|
22
|
-
|
23
|
-
sash_form = active_shell.children.to_a.first
|
24
|
-
tab_folders = sash_form.children.to_a[1].children.to_a[0].children.to_a.select{|c| c.is_a? Swt::Custom::CTabFolder}
|
25
|
-
items = tab_folders.map{|f| f.getItems.to_a}.flatten
|
27
|
+
items = get_tab_folders.map{|f| f.getItems.to_a}.flatten
|
26
28
|
items.map {|i| model_tab_for_item(i)}
|
27
29
|
end
|
28
30
|
|
@@ -13,6 +13,8 @@ require "edit_view/edit_tab"
|
|
13
13
|
require "edit_view/modified_tabs_checker"
|
14
14
|
require "edit_view/tab_settings"
|
15
15
|
require "edit_view/info_speedbar"
|
16
|
+
require "edit_view/select_font_dialog"
|
17
|
+
require "edit_view/select_theme_dialog"
|
16
18
|
|
17
19
|
module Redcar
|
18
20
|
class EditView
|
@@ -185,8 +187,8 @@ module Redcar
|
|
185
187
|
default_font = "Courier New"
|
186
188
|
default_font_size = 9
|
187
189
|
end
|
188
|
-
[
|
189
|
-
|
190
|
+
[ EditView.storage["font"] || default_font,
|
191
|
+
EditView.storage["font-size"] || default_font_size ]
|
190
192
|
end
|
191
193
|
|
192
194
|
def self.font
|
@@ -197,10 +199,37 @@ module Redcar
|
|
197
199
|
font_info[1]
|
198
200
|
end
|
199
201
|
|
200
|
-
def self.
|
201
|
-
|
202
|
+
def self.font=(font)
|
203
|
+
EditView.storage["font"] = font
|
204
|
+
all_edit_views.each {|ev| ev.refresh_font }
|
202
205
|
end
|
203
206
|
|
207
|
+
def refresh_font
|
208
|
+
notify_listeners(:font_changed)
|
209
|
+
end
|
210
|
+
|
211
|
+
def self.font_size=(size)
|
212
|
+
EditView.storage["font-size"] = size
|
213
|
+
all_edit_views.each {|ev| ev.refresh_font }
|
214
|
+
end
|
215
|
+
|
216
|
+
def self.theme
|
217
|
+
EditView.storage["theme"] || "Twilight"
|
218
|
+
end
|
219
|
+
|
220
|
+
def self.theme=(theme)
|
221
|
+
EditView.storage["theme"] = theme
|
222
|
+
all_edit_views.each {|ev| ev.refresh_theme }
|
223
|
+
end
|
224
|
+
|
225
|
+
def self.themes
|
226
|
+
@themes ||= []
|
227
|
+
end
|
228
|
+
|
229
|
+
def refresh_theme
|
230
|
+
notify_listeners(:theme_changed)
|
231
|
+
end
|
232
|
+
|
204
233
|
def self.focussed_tab_edit_view
|
205
234
|
Redcar.app.focussed_notebook_tab.edit_view if Redcar.app.focussed_notebook_tab and Redcar.app.focussed_notebook_tab.edit_tab?
|
206
235
|
end
|
@@ -246,9 +275,14 @@ module Redcar
|
|
246
275
|
|
247
276
|
def set_grammar(name)
|
248
277
|
@grammar = name
|
249
|
-
self.tab_width
|
250
|
-
self.soft_tabs
|
278
|
+
self.tab_width = EditView.tab_settings.width_for(name)
|
279
|
+
self.soft_tabs = EditView.tab_settings.softness_for(name)
|
280
|
+
self.word_wrap = EditView.tab_settings.word_wrap_for(name)
|
281
|
+
self.margin_column = EditView.tab_settings.margin_column_for(name)
|
282
|
+
self.show_margin = EditView.tab_settings.show_margin_for(name)
|
251
283
|
refresh_show_invisibles
|
284
|
+
refresh_show_line_numbers
|
285
|
+
refresh_show_annotations
|
252
286
|
end
|
253
287
|
|
254
288
|
def focus
|
@@ -279,6 +313,36 @@ module Redcar
|
|
279
313
|
notify_listeners(:softness_changed, bool)
|
280
314
|
end
|
281
315
|
|
316
|
+
def show_margin?
|
317
|
+
@show_margin
|
318
|
+
end
|
319
|
+
|
320
|
+
def show_margin=(bool)
|
321
|
+
@show_margin = bool
|
322
|
+
EditView.tab_settings.set_show_margin_for(grammar, bool)
|
323
|
+
notify_listeners(:show_margin_changed, bool)
|
324
|
+
end
|
325
|
+
|
326
|
+
def word_wrap?
|
327
|
+
@word_wrap
|
328
|
+
end
|
329
|
+
|
330
|
+
def word_wrap=(bool)
|
331
|
+
@word_wrap = bool
|
332
|
+
EditView.tab_settings.set_word_wrap_for(grammar, bool)
|
333
|
+
notify_listeners(:word_wrap_changed, bool)
|
334
|
+
end
|
335
|
+
|
336
|
+
def margin_column
|
337
|
+
@margin_column
|
338
|
+
end
|
339
|
+
|
340
|
+
def margin_column=(val)
|
341
|
+
@margin_column = val
|
342
|
+
EditView.tab_settings.set_margin_column_for(grammar, val)
|
343
|
+
notify_listeners(:margin_column_changed, val)
|
344
|
+
end
|
345
|
+
|
282
346
|
def show_invisibles?
|
283
347
|
@show_invisibles
|
284
348
|
end
|
@@ -297,6 +361,42 @@ module Redcar
|
|
297
361
|
notify_listeners(:invisibles_changed, @show_invisibles)
|
298
362
|
end
|
299
363
|
|
364
|
+
def show_line_numbers?
|
365
|
+
@show_line_numbers
|
366
|
+
end
|
367
|
+
|
368
|
+
def self.show_line_numbers?
|
369
|
+
EditView.tab_settings.show_line_numbers?
|
370
|
+
end
|
371
|
+
|
372
|
+
def self.show_line_numbers=(bool)
|
373
|
+
EditView.tab_settings.set_show_line_numbers(bool)
|
374
|
+
all_edit_views.each {|ev| ev.refresh_show_line_numbers }
|
375
|
+
end
|
376
|
+
|
377
|
+
def refresh_show_line_numbers
|
378
|
+
@show_line_numbers = EditView.tab_settings.show_line_numbers?
|
379
|
+
notify_listeners(:line_number_visibility_changed, @show_line_numbers)
|
380
|
+
end
|
381
|
+
|
382
|
+
def show_annotations?
|
383
|
+
@show_annotations
|
384
|
+
end
|
385
|
+
|
386
|
+
def self.show_annotations?
|
387
|
+
EditView.tab_settings.show_annotations?
|
388
|
+
end
|
389
|
+
|
390
|
+
def self.show_annotations=(bool)
|
391
|
+
EditView.tab_settings.set_show_annotations(bool)
|
392
|
+
all_edit_views.each {|ev| ev.refresh_show_annotations }
|
393
|
+
end
|
394
|
+
|
395
|
+
def refresh_show_annotations
|
396
|
+
@show_annotations = EditView.tab_settings.show_annotations?
|
397
|
+
notify_listeners(:annotations_visibility_changed, @show_annotations)
|
398
|
+
end
|
399
|
+
|
300
400
|
def title=(title)
|
301
401
|
notify_listeners(:title_changed, title)
|
302
402
|
end
|
@@ -19,6 +19,20 @@ module Redcar
|
|
19
19
|
@tab.edit_view.soft_tabs = new_value
|
20
20
|
end
|
21
21
|
|
22
|
+
toggle :word_wrap, "Word Wrap", nil, false do |new_value|
|
23
|
+
@tab.edit_view.word_wrap = new_value
|
24
|
+
end
|
25
|
+
|
26
|
+
label :margin_column_label, "Margin:"
|
27
|
+
|
28
|
+
toggle :show_margin, "", nil, TabSettings::DEFAULT_MARGIN_PRESENT do |new_value|
|
29
|
+
@tab.edit_view.show_margin = new_value
|
30
|
+
end
|
31
|
+
|
32
|
+
textbox :margin_column, TabSettings::DEFAULT_MARGIN_COLUMN.to_s do |new_value|
|
33
|
+
@tab.edit_view.margin_column = [new_value.to_i, 5].max
|
34
|
+
end
|
35
|
+
|
22
36
|
def initialize(command, tab)
|
23
37
|
@command = command
|
24
38
|
tab_changed(tab)
|
@@ -32,17 +46,29 @@ module Redcar
|
|
32
46
|
@tab = new_tab
|
33
47
|
grammar.items = InfoSpeedbar.grammar_names
|
34
48
|
grammar.value = @tab.edit_view.grammar
|
35
|
-
tab_width.value = @tab.edit_view.tab_width.to_s
|
36
|
-
soft_tabs.value = @tab.edit_view.soft_tabs?
|
49
|
+
tab_width.value = @tab.edit_view.tab_width.to_s
|
50
|
+
soft_tabs.value = @tab.edit_view.soft_tabs?
|
51
|
+
word_wrap.value = @tab.edit_view.word_wrap?
|
52
|
+
show_margin.value = @tab.edit_view.show_margin?
|
53
|
+
margin_column.value = @tab.edit_view.margin_column.to_s
|
37
54
|
@width_handler = @tab.edit_view.add_listener(:tab_width_changed) do |new_value|
|
38
55
|
tab_width.value = new_value.to_s
|
39
56
|
end
|
57
|
+
@margin_column_handler = @tab.edit_view.add_listener(:margin_column_changed) do |new_value|
|
58
|
+
margin_column.value = new_value.to_s
|
59
|
+
end
|
40
60
|
@softness_handler = @tab.edit_view.add_listener(:softness_changed) do |new_value|
|
41
61
|
soft_tabs.value = new_value
|
42
62
|
end
|
63
|
+
@word_wrap_handler = @tab.edit_view.add_listener(:word_wrap_changed) do |new_value|
|
64
|
+
word_wrap.value = new_value
|
65
|
+
end
|
43
66
|
@grammar_handler = @tab.edit_view.add_listener(:grammar_changed) do |new_grammar|
|
44
67
|
grammar.value = new_grammar
|
45
68
|
end
|
69
|
+
@show_margin_handler = @tab.edit_view.add_listener(:show_margin_changed) do |new_value|
|
70
|
+
show_margin.value = new_value
|
71
|
+
end
|
46
72
|
end
|
47
73
|
end
|
48
74
|
|
@@ -50,7 +76,10 @@ module Redcar
|
|
50
76
|
@tab.edit_view.remove_listener(@width_handler)
|
51
77
|
@tab.edit_view.remove_listener(@grammar_handler)
|
52
78
|
@tab.edit_view.remove_listener(@softness_handler)
|
53
|
-
|
79
|
+
@tab.edit_view.remove_listener(@word_wrap_handler)
|
80
|
+
@tab.edit_view.remove_listener(@margin_column_handler)
|
81
|
+
@tab.edit_view.remove_listener(@show_margin_handler)
|
82
|
+
end
|
54
83
|
|
55
84
|
def close
|
56
85
|
if @tab
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Redcar
|
2
|
+
class EditView
|
3
|
+
class SelectFontDialog < FilterListDialog
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
super()
|
7
|
+
fontdata = Redcar.app.focussed_window.controller.shell.get_display.get_font_list(nil, true)
|
8
|
+
@matches = []
|
9
|
+
(0..(fontdata.length-1)).each do |i|
|
10
|
+
@matches << fontdata[i].get_name unless @matches.include?(fontdata[i].get_name)
|
11
|
+
end
|
12
|
+
@matches.sort!
|
13
|
+
end
|
14
|
+
|
15
|
+
def close
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def update_list(filter)
|
20
|
+
@last_list = @matches
|
21
|
+
filtered_list = @last_list
|
22
|
+
if filter.length >= 1
|
23
|
+
filtered_list = filter_and_rank_by(filtered_list, filter, filtered_list.length) do |match|
|
24
|
+
match
|
25
|
+
end
|
26
|
+
end
|
27
|
+
filtered_list
|
28
|
+
end
|
29
|
+
|
30
|
+
def selected(text, ix, closing=false)
|
31
|
+
if @last_list
|
32
|
+
close
|
33
|
+
Redcar::EditView.font = text
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|