arcadia 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +11 -28
- data/ext/ae-breakpoints/ae-breakpoints.rb +44 -19
- data/ext/ae-dir-projects/ae-dir-projects.rb +38 -35
- data/ext/ae-editor/ae-editor.rb +252 -97
- data/ext/ae-file-history/ae-file-history.rb +30 -31
- data/ext/ae-output/ae-output.rb +137 -133
- data/ext/ae-ruby-debug/ae-ruby-debug.conf +4 -2
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +95 -47
- data/ext/ae-search-in-files/ae-search-in-files.rb +32 -37
- data/ext/ae-shell/ae-shell.rb +1 -0
- data/lib/a-commons.rb +22 -16
- data/lib/a-contracts.rb +7 -2
- data/lib/a-core.rb +24 -12
- data/lib/a-tkcommons.rb +31 -3
- metadata +5 -5
@@ -7,8 +7,10 @@ frames.names=ruby_debug_inspector,ruby_debug_server
|
|
7
7
|
active=yes
|
8
8
|
require=ext/ae-ruby-debug/ae-ruby-debug
|
9
9
|
class=RubyDebug
|
10
|
-
gems=ruby-debug,whichr
|
11
|
-
1.9:@:gems=ruby-debug19,whichr
|
10
|
+
#gems=ruby-debug,whichr
|
11
|
+
#1.9:@:gems=ruby-debug19,whichr
|
12
|
+
gems=ruby-debug
|
13
|
+
1.9:@:gems=ruby-debug19
|
12
14
|
#========================================
|
13
15
|
#========================================
|
14
16
|
server.host=localhost
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
4
|
#
|
5
5
|
|
6
|
-
require 'whichr'
|
6
|
+
#require 'whichr'
|
7
7
|
|
8
8
|
class RubyDebugView
|
9
9
|
include TkUtil
|
@@ -125,17 +125,18 @@ class RubyDebugView
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def build_process_panel(_frame)
|
128
|
-
@tree_process =
|
128
|
+
@tree_process = BWidgetTreePatched.new(_frame, Arcadia.style('treepanel')){
|
129
129
|
showlines false
|
130
130
|
deltay 15
|
131
131
|
place('relwidth' => 1,'relheight' => '1')
|
132
132
|
}
|
133
133
|
@tree_process.textbind("Double-ButtonPress-1", proc{
|
134
|
-
_selected = @tree_process.selection_get[0]
|
134
|
+
#_selected = @tree_process.selection_get[0]
|
135
|
+
_selected = @tree_process.selected
|
135
136
|
if @tree_process.parent(_selected)=='client'
|
136
137
|
_text = @tree_process.itemcget(_selected, 'text')
|
137
138
|
pos = match_position_from_stack(_text)
|
138
|
-
if pos.length >0
|
139
|
+
if pos && pos.length >0
|
139
140
|
Arcadia.process_event(OpenBufferEvent.new(self,'file'=>pos[0], 'row'=>pos[1]))
|
140
141
|
#EditorContract.instance.open_file(self, 'file'=>pos[0], 'line'=>pos[1])
|
141
142
|
end
|
@@ -181,7 +182,7 @@ class RubyDebugView
|
|
181
182
|
inspect_node(_arg) if @nodes_to_open.include?(_arg)
|
182
183
|
end
|
183
184
|
|
184
|
-
@tree_var =
|
185
|
+
@tree_var = BWidgetTreePatched.new(_frame, Arcadia.style('treepanel')){
|
185
186
|
showlines false
|
186
187
|
deltay 15
|
187
188
|
opencmd _open_proc
|
@@ -200,7 +201,8 @@ class RubyDebugView
|
|
200
201
|
# @tree_var.yscrollcommand proc{|first,last| _scrollbar.set(first,last)}
|
201
202
|
|
202
203
|
@tree_var.textbind("Double-ButtonPress-1", proc{
|
203
|
-
_selected = @tree_var.selection_get[0]
|
204
|
+
#_selected = @tree_var.selection_get[0]
|
205
|
+
_selected = @tree_var.selected
|
204
206
|
_msg = @tree_var.itemcget(_selected, 'text')
|
205
207
|
Arcadia.dialog(self, 'type'=>'ok','title' => 'Value', 'msg' => _msg, 'level'=>'info')
|
206
208
|
})
|
@@ -493,14 +495,16 @@ class RubyDebugView
|
|
493
495
|
elsif _command == 'cont' && !_result.downcase.include?('breakpoint')
|
494
496
|
@controller.rdc.kill
|
495
497
|
clear
|
496
|
-
elsif _command != 'where' && _command != 'quit_yes'
|
498
|
+
elsif _command != 'where' && _command != 'quit_yes' && @controller.rdc.is_alive?
|
497
499
|
begin
|
498
500
|
update_position
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
501
|
+
if @controller.rdc.is_alive?
|
502
|
+
update_variables('local_var', @controller.rdc.variables('local_variables')) if @local_state == B_STATE_ON
|
503
|
+
update_variables('instance_var', @controller.rdc.variables('instance_variables')) if @instance_state == B_STATE_ON
|
504
|
+
update_variables('class_var', @controller.rdc.variables('self.class.class_variables')) if @class_state == B_STATE_ON
|
505
|
+
#Arcadia.new_debug_msg(self,"on command #{_command}:global_variables")
|
506
|
+
update_variables('global_var', @controller.rdc.variables('global_variables')) if @global_state == B_STATE_ON
|
507
|
+
end
|
504
508
|
ensure
|
505
509
|
command_enabled(true) if !@controller.rdc.nil? && @controller.rdc.is_debugging_ready? && (!_command.include?('quit') || _command.include?('quit_no'))
|
506
510
|
end
|
@@ -514,7 +518,8 @@ class RubyDebugView
|
|
514
518
|
def match_position_from_stack(_line)
|
515
519
|
#Arcadia.new_error_msg(self, "match on #{_line}")
|
516
520
|
ret = Array.new
|
517
|
-
matchline = _line.match(/#*([0-9]*)[\s\w\W]*\s(
|
521
|
+
#matchline = _line.match(/#*([0-9]*)[\s\w\W]*\s([\w\:]*[\.\/]*[\/A-Za-z_\-\.]*[\.\/\w\d]*):(\d*)/)
|
522
|
+
matchline = _line.match(/#*([0-9]*)[\s\w\W]*line\s(.*):([0-9]*)(.*)/)
|
518
523
|
if !matchline.nil? && matchline.length==5
|
519
524
|
#Arcadia.new_error_msg(self, "matchline[2]=#{matchline[2]}")
|
520
525
|
#Arcadia.new_error_msg(self, "matchline[3]=#{matchline[3]}")
|
@@ -538,9 +543,8 @@ class RubyDebugView
|
|
538
543
|
elsif !stack[0].nil?
|
539
544
|
pos = match_position_from_stack(stack[0])
|
540
545
|
end
|
541
|
-
if pos.length > 0
|
546
|
+
if pos && pos.length > 0
|
542
547
|
_file = pos[0]
|
543
|
-
#p "_file=#{_file}"
|
544
548
|
_file = File.expand_path(pos[0]) if !File.exist?(_file)
|
545
549
|
Arcadia.broadcast_event(DebugStepInfoEvent.new(self,'file'=> _file, 'row'=>pos[1]))
|
546
550
|
#DebugContract.instance.debug_step(self, 'file'=> _file, 'line'=>pos[1])
|
@@ -674,7 +678,11 @@ class RubyDebugView
|
|
674
678
|
def var_name(_node)
|
675
679
|
#_parent = @tree_var.parent(_node)
|
676
680
|
#return _node.sub("#{_parent}_", '')
|
677
|
-
|
681
|
+
to_split= _node
|
682
|
+
if _node.instance_of?(Array) && _node.length > 0
|
683
|
+
to_split=_node[0].to_s
|
684
|
+
end
|
685
|
+
return to_split.split('@@@')[-1].gsub('__S__','$').gsub('__E__','&').gsub('__D__',':').gsub('__A__','!')
|
678
686
|
end
|
679
687
|
|
680
688
|
def command_enabled(_value)
|
@@ -772,17 +780,19 @@ class RubyDebugServer
|
|
772
780
|
end
|
773
781
|
|
774
782
|
def start_session_new(_filename, _host='localhost', _remote_port='8989')
|
775
|
-
if is_windows?
|
776
|
-
if RubyWhich.new.which("rdebug.bat") != []
|
783
|
+
if Arcadia.is_windows?
|
784
|
+
#if RubyWhich.new.which("rdebug.bat") != []
|
785
|
+
if Arcadia.which("rdebug.bat")
|
777
786
|
rdebug_cmd = "rdebug.bat"
|
778
|
-
elsif RubyWhich.new.which("rdebug.cmd") != []
|
787
|
+
#elsif RubyWhich.new.which("rdebug.cmd") != []
|
788
|
+
elsif Arcadia.which("rdebug.cmd")
|
779
789
|
rdebug_cmd = "rdebug.cmd"
|
780
790
|
else
|
781
791
|
rdebug_cmd = "rdebug"
|
782
792
|
end
|
783
793
|
commandLine = "#{rdebug_cmd} --host #{_host} --port #{_remote_port} -sw #{_filename}"
|
784
794
|
else
|
785
|
-
|
795
|
+
commandLine = "rdebug --host #{_host} --port #{_remote_port} -sw #{_filename}"
|
786
796
|
end
|
787
797
|
#Arcadia.process_event(SystemExecEvent.new(self, 'command'=>commandLine))
|
788
798
|
Arcadia.process_event(RunCmdEvent.new(self, 'cmd'=>commandLine, 'file'=>_filename))
|
@@ -796,22 +806,25 @@ class RubyDebugServer
|
|
796
806
|
@alive = _value
|
797
807
|
end
|
798
808
|
|
799
|
-
def start_session(
|
800
|
-
|
801
|
-
|
809
|
+
def start_session(_debug_event, _host='localhost', _remote_port='8989')
|
810
|
+
_filename = _debug_event.file
|
811
|
+
if Arcadia.is_windows?
|
812
|
+
#if RubyWhich.new.which("rdebug.bat") != []
|
813
|
+
if Arcadia.which("rdebug.bat")
|
802
814
|
rdebug_cmd = "rdebug.bat"
|
803
|
-
elsif RubyWhich.new.which("rdebug.cmd") != []
|
815
|
+
#elsif RubyWhich.new.which("rdebug.cmd") != []
|
816
|
+
elsif Arcadia.which("rdebug.cmd")
|
804
817
|
rdebug_cmd = "rdebug.cmd"
|
805
818
|
else
|
806
819
|
rdebug_cmd = "rdebug"
|
807
820
|
end
|
808
|
-
commandLine = "#{rdebug_cmd} --port #{_remote_port} -sw #{_filename}"
|
821
|
+
commandLine = "#{rdebug_cmd} --host #{_host} --port #{_remote_port} -sw '#{_filename}'"
|
809
822
|
else
|
810
823
|
commandLine = "rdebug --host #{_host} --port #{_remote_port} -sw #{_filename}"
|
811
824
|
end
|
812
825
|
begin
|
813
826
|
@alive = true
|
814
|
-
if is_windows?
|
827
|
+
if Arcadia.is_windows?
|
815
828
|
@tid = Thread.new do
|
816
829
|
if Kernel.system(commandLine)
|
817
830
|
Kernel.system('y')
|
@@ -827,6 +840,10 @@ class RubyDebugServer
|
|
827
840
|
end
|
828
841
|
set_alive(false)
|
829
842
|
notify(RDS_QUIET)
|
843
|
+
if _debug_event.persistent == false && _debug_event.file[-2..-1] == '~~'
|
844
|
+
File.delete(_debug_event.file) if File.exist?(_debug_event.file)
|
845
|
+
end
|
846
|
+
|
830
847
|
end
|
831
848
|
else
|
832
849
|
@pid = Process.fork do
|
@@ -848,12 +865,18 @@ class RubyDebugServer
|
|
848
865
|
#p "alive=#{is_alive?}"
|
849
866
|
notify(RDS_QUIET)
|
850
867
|
Kernel.system('y')
|
868
|
+
|
869
|
+
if _debug_event.persistent == false && _debug_event.file[-2..-1] == '~~'
|
870
|
+
File.delete(_debug_event.file) if File.exist?(_debug_event.file)
|
871
|
+
end
|
872
|
+
|
851
873
|
Kernel.exit!
|
852
874
|
else
|
853
875
|
Kernel.exit!
|
854
876
|
Arcadia.console(self, 'msg'=>"#{$?.inspect}", 'level'=>'debug')
|
855
877
|
#Arcadia.new_debug_msg(self,"#{$?.inspect}")
|
856
878
|
end
|
879
|
+
|
857
880
|
#p "@alive=#{@alive}"
|
858
881
|
#notify(RDS_QUIET)
|
859
882
|
#Process.wait
|
@@ -867,7 +890,7 @@ class RubyDebugServer
|
|
867
890
|
|
868
891
|
def kill
|
869
892
|
begin
|
870
|
-
if is_windows?
|
893
|
+
if Arcadia.is_windows?
|
871
894
|
@tid.join(2)
|
872
895
|
@tid.kill!
|
873
896
|
else
|
@@ -880,10 +903,6 @@ class RubyDebugServer
|
|
880
903
|
end
|
881
904
|
end
|
882
905
|
|
883
|
-
def is_windows?
|
884
|
-
!(RUBY_PLATFORM =~ /(win|w)32$/).nil?
|
885
|
-
end
|
886
|
-
|
887
906
|
def notify(_state)
|
888
907
|
#p "----- notify ----- #{_state}"
|
889
908
|
changed
|
@@ -1092,7 +1111,7 @@ class RubyDebugClient
|
|
1092
1111
|
end
|
1093
1112
|
#_command !="cont"
|
1094
1113
|
true
|
1095
|
-
rescue Errno::ECONNABORTED => e
|
1114
|
+
rescue Errno::ECONNABORTED,Errno::ECONNRESET, Errno::EPIPE => e
|
1096
1115
|
notify("quit_yes")
|
1097
1116
|
#DebugContract.instance.debug_end(self)
|
1098
1117
|
Arcadia.console(self, 'msg'=>"Debugger has finished executing:\n #{e.class}:#{e.inspect}", 'level'=>'debug')
|
@@ -1110,7 +1129,8 @@ class RubyDebugClient
|
|
1110
1129
|
private :command
|
1111
1130
|
|
1112
1131
|
def read(_command=nil)
|
1113
|
-
return nil if _command && !command(_command)
|
1132
|
+
return nil if _command && !command(_command)
|
1133
|
+
#return nil if _command.nil? || (_command && !command(_command))
|
1114
1134
|
result = ""
|
1115
1135
|
if socket_session
|
1116
1136
|
@session.flush
|
@@ -1334,10 +1354,18 @@ class RubyDebugClient
|
|
1334
1354
|
end
|
1335
1355
|
|
1336
1356
|
def debug_eval(_exp)
|
1337
|
-
command("eval #{res=_exp}.to_s + '|||' + #{res}.class.to_s")
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1357
|
+
if command("eval #{res=_exp}.to_s + '|||' + #{res}.class.to_s")
|
1358
|
+
begin
|
1359
|
+
_str = eval(read)
|
1360
|
+
_value, _class = _str.split('|||')
|
1361
|
+
rescue Exception => e
|
1362
|
+
_value = "?"
|
1363
|
+
_class = "?"
|
1364
|
+
end
|
1365
|
+
return Var.new(_value, _class)
|
1366
|
+
else
|
1367
|
+
return Var.new("?", "?")
|
1368
|
+
end
|
1341
1369
|
end
|
1342
1370
|
|
1343
1371
|
# returns the local variables and there values
|
@@ -1381,13 +1409,14 @@ class RubyDebugClient
|
|
1381
1409
|
def set_breakpoint(_file, _line)
|
1382
1410
|
#_line = _line + 1
|
1383
1411
|
text = read("break #{_file}:#{_line}")
|
1412
|
+
return if text.nil?
|
1384
1413
|
#p text
|
1385
1414
|
breakpoint_no = -1
|
1386
1415
|
#matches = text.match(/Set breakpoint ([0-9]*)?/)
|
1387
1416
|
matches = text.downcase.match(/breakpoint ([0-9]*)?/)
|
1388
1417
|
#Arcadia.new_error_msg(self, "text=#{text}")
|
1389
1418
|
#Arcadia.new_error_msg(self, "matches[1]=#{matches[1]}")
|
1390
|
-
breakpoint_no = matches[1].to_i if (matches.length == 2)
|
1419
|
+
breakpoint_no = matches[1].to_i if matches && (matches.length == 2)
|
1391
1420
|
return breakpoint_no
|
1392
1421
|
end
|
1393
1422
|
|
@@ -1397,11 +1426,11 @@ class RubyDebugClient
|
|
1397
1426
|
end
|
1398
1427
|
|
1399
1428
|
class RubyDebug < ArcadiaExt
|
1400
|
-
include Autils
|
1401
1429
|
attr_reader :rds
|
1402
1430
|
attr_reader :rdc
|
1403
1431
|
def on_before_build(_event)
|
1404
|
-
if RubyWhich.new.which("rdebug") != []
|
1432
|
+
#if RubyWhich.new.which("rdebug") != []
|
1433
|
+
if Arcadia.which("rdebug") || ((Arcadia.which("rdebug.bat") || Arcadia.which("rdebug.cmd"))&& Arcadia.is_windows?)
|
1405
1434
|
@breakpoints = Hash.new
|
1406
1435
|
@static_breakpoints = Array.new
|
1407
1436
|
Arcadia.attach_listener(self, BufferEvent)
|
@@ -1426,10 +1455,11 @@ class RubyDebug < ArcadiaExt
|
|
1426
1455
|
def on_debug(_event)
|
1427
1456
|
case _event
|
1428
1457
|
when StartDebugEvent
|
1458
|
+
return if _event.file.nil?
|
1429
1459
|
_filename = _event.file
|
1430
1460
|
_filename = @arcadia['pers']['run.file.last'] if _filename == "*LAST"
|
1431
|
-
if File.exist?(_filename)
|
1432
|
-
|
1461
|
+
if _filename && File.exist?(_filename)
|
1462
|
+
do_debug(_event)
|
1433
1463
|
else
|
1434
1464
|
Arcadia.dialog(self,
|
1435
1465
|
'type'=>'ok',
|
@@ -1447,8 +1477,13 @@ class RubyDebug < ArcadiaExt
|
|
1447
1477
|
#p "on_debug --> @rdc.is_alive?=#{@rdc.is_alive?}"
|
1448
1478
|
#p "on_debug --> @rds.is_alive?=#{@rds.is_alive?}"
|
1449
1479
|
when SetBreakpointEvent
|
1450
|
-
|
1480
|
+
if _event.file
|
1481
|
+
self.breakpoint_add(File.expand_path(_event.file), _event.row)
|
1482
|
+
elsif _event.id
|
1483
|
+
self.breakpoint_add(_event.id, _event.row)
|
1484
|
+
end
|
1451
1485
|
when UnsetBreakpointEvent
|
1486
|
+
return if _event.file.nil?
|
1452
1487
|
self.breakpoint_del(File.expand_path(_event.file), _event.row)
|
1453
1488
|
when EvalExpressionEvent
|
1454
1489
|
eval_expression(_event.expression)
|
@@ -1520,6 +1555,15 @@ class RubyDebug < ArcadiaExt
|
|
1520
1555
|
@static_breakpoints << {:file=>_file,:line=>_line}
|
1521
1556
|
end
|
1522
1557
|
#private :breakpoint_add
|
1558
|
+
def static_breakpoints_of_file(_filename)
|
1559
|
+
ret = Array.new
|
1560
|
+
@static_breakpoints.each{|b|
|
1561
|
+
if b[:file]==_filename
|
1562
|
+
ret << b
|
1563
|
+
end
|
1564
|
+
}
|
1565
|
+
ret
|
1566
|
+
end
|
1523
1567
|
|
1524
1568
|
def breakpoint_del(_file,_line)
|
1525
1569
|
breakpoint_del_live(_file,_line)
|
@@ -1562,13 +1606,14 @@ class RubyDebug < ArcadiaExt
|
|
1562
1606
|
#DebugContract.instance.debug_begin(self)
|
1563
1607
|
end
|
1564
1608
|
|
1565
|
-
def
|
1609
|
+
def do_debug(_event)
|
1610
|
+
_filename = _event.file
|
1566
1611
|
if _filename && !debugging?
|
1567
1612
|
begin
|
1568
1613
|
self.debug_begin
|
1569
|
-
@arcadia['pers']['run.file.last']=_filename
|
1614
|
+
@arcadia['pers']['run.file.last']=_filename if _event.persistent
|
1570
1615
|
@rds = RubyDebugServer.new(self,@arcadia) if @rds.nil?
|
1571
|
-
@rds.start_session(
|
1616
|
+
@rds.start_session(_event, conf('server.host'), conf('server.port'))
|
1572
1617
|
#Arcadia.new_msg(self,@rds.to_s)
|
1573
1618
|
|
1574
1619
|
@rdc = RubyDebugClient.new(self, conf('server.host'), conf('server.port'), conf('server.timeout')) if @rdc.nil?
|
@@ -1577,10 +1622,13 @@ class RubyDebug < ArcadiaExt
|
|
1577
1622
|
@rdv.start_process(_filename)
|
1578
1623
|
if @rdc.start_session
|
1579
1624
|
@static_breakpoints.each{|_b|
|
1625
|
+
if !_event.persistent && _b[:file]==_event.id
|
1626
|
+
_b[:file]=_filename
|
1627
|
+
end
|
1580
1628
|
#Arcadia.console(self,'msg'=>" breakpoint_add #{_b[:file]}:#{_b[:line]}")
|
1581
1629
|
breakpoint_add_live(_b[:file], _b[:line])
|
1582
1630
|
}
|
1583
|
-
if
|
1631
|
+
if static_breakpoints_of_file(_filename).length > 0 && conf("auto_resume_break_on_first_line")!='no'
|
1584
1632
|
@rdv.debug_send(:resume)
|
1585
1633
|
end
|
1586
1634
|
end
|
@@ -37,7 +37,8 @@ class SearchInFilesListener
|
|
37
37
|
@find = FindFrame.new(@service.arcadia.layout.root)
|
38
38
|
@find.on_close=proc{@find.hide}
|
39
39
|
@find.hide
|
40
|
-
@find.b_go.bind('1', proc{
|
40
|
+
@find.b_go.bind('1', proc{update_all_combo;do_find}) # add trigger to button
|
41
|
+
#@find.b_go.bind('1', proc{Thread.new{update_all_combo;do_find}}) # add trigger to button
|
41
42
|
|
42
43
|
enter_proc = proc {|e|
|
43
44
|
case e.keysym
|
@@ -91,37 +92,37 @@ class SearchInFilesListener
|
|
91
92
|
@search_output = SearchOutput.new(@service)
|
92
93
|
end
|
93
94
|
@service.frame.show_anyway
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
95
|
+
Thread.new do
|
96
|
+
begin
|
97
|
+
MonitorLastUsedDir.set_last @find.e_dir.text # save it away TODO make it into a message
|
98
|
+
|
99
|
+
_search_title = 'search result for : "'+@find.e_what.text+'" in :"'+@find.e_dir.text+'"'+' ['+@find.e_filter.text+']'
|
100
|
+
_filter = @find.e_dir.text+'/**/'+@find.e_filter.text
|
101
|
+
_files = Dir[_filter]
|
102
|
+
_node = @search_output.new_result(_search_title, _files.length)
|
103
|
+
progress_stop=false
|
104
|
+
progress_bar = TkProgressframe.new(@service.arcadia.layout.root, _files.length)
|
105
|
+
progress_bar.title('Searching')
|
106
|
+
progress_bar.on_cancel=proc{progress_stop=true}
|
107
|
+
#@progress_bar.on_cancel=proc{cancel}
|
108
|
+
pattern = Regexp.new(@find.e_what.text)
|
109
|
+
_files.each do |_filename|
|
110
|
+
File.open(_filename) do |file|
|
111
|
+
file.grep(pattern) do |line|
|
112
|
+
@search_output.add_result(_node, _filename, file.lineno.to_s, line)
|
113
|
+
break if progress_stop
|
114
|
+
end
|
113
115
|
end
|
114
|
-
|
115
|
-
|
116
|
-
|
116
|
+
progress_bar.progress
|
117
|
+
break if progress_stop
|
118
|
+
end
|
119
|
+
rescue Exception => e
|
120
|
+
Arcadia.console(self, 'msg'=>e.message, 'level'=>'error')
|
121
|
+
#Arcadia.new_error_msg(self, e.message)
|
122
|
+
ensure
|
123
|
+
progress_bar.destroy if progress_bar
|
117
124
|
end
|
118
|
-
rescue Exception => e
|
119
|
-
Arcadia.console(self, 'msg'=>e.message, 'level'=>'error')
|
120
|
-
#Arcadia.new_error_msg(self, e.message)
|
121
|
-
ensure
|
122
|
-
@progress_bar.destroy if @progress_bar
|
123
125
|
end
|
124
|
-
|
125
126
|
end
|
126
127
|
|
127
128
|
|
@@ -132,22 +133,16 @@ class SearchOutput
|
|
132
133
|
@sequence = 0
|
133
134
|
@ext = _ext
|
134
135
|
left_frame = TkFrame.new(@ext.frame.hinner_frame, Arcadia.style('panel')).place('x' => '0','y' => '0','relheight' => '1','width' => '25')
|
135
|
-
#right_frame = TkFrame.new(@ext.frame).place('x' => '25','y' => '0','relwidth' => '1', 'relheight' => '1', 'width' => '-25')
|
136
|
+
#right_frame = TkFrame.new(@ext.frame.hinner_frame, Arcadia.style('panel')).place('x' => '25','y' => '0','relwidth' => '1', 'relheight' => '1', 'width' => '-25')
|
136
137
|
@results = {}
|
137
138
|
_open_file = proc do |tree, sel|
|
138
139
|
n_parent, n = sel.split('@@@')
|
139
140
|
Arcadia.process_event(OpenBufferTransientEvent.new(self,'file'=>@results[n_parent][n][0], 'row'=>@results[n_parent][n][1])) if n && @results[n_parent][n]
|
140
|
-
#EditorContract.instance.open_file(self, 'file'=>@results[n_parent][n][0], 'line'=>@results[n_parent][n][1]) if n && @results[n_parent][n]
|
141
141
|
end
|
142
|
-
@tree =
|
143
|
-
#background '#FFFFFF'
|
144
|
-
#relief 'flat'
|
145
|
-
#showlines true
|
146
|
-
#linesfill '#e7de8f'
|
142
|
+
@tree = BWidgetTreePatched.new(@ext.frame.hinner_frame, Arcadia.style('treepanel')){
|
147
143
|
selectcommand(_open_file)
|
148
144
|
deltay 15
|
149
145
|
}
|
150
|
-
#.place('x' => '25','y' => '0','relwidth' => '1', 'relheight' => '1', 'width' => '-40', 'height'=>'-15')
|
151
146
|
@tree.extend(TkScrollableWidget).show(25,0)
|
152
147
|
|
153
148
|
_proc_clear = proc{clear_tree}
|