Skip to content

Commit

Permalink
v. 0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
angal committed Jun 3, 2011
1 parent 867d27d commit 24ce20a
Show file tree
Hide file tree
Showing 24 changed files with 2,948 additions and 343 deletions.
6 changes: 3 additions & 3 deletions conf/arcadia.conf
Expand Up @@ -408,9 +408,9 @@ user_menu.menubutton_new.new_java_file.image_data=!FILE_ICON_JAVA
user_menu.menubutton_new.new_java_file.action=NewBufferEvent.new(self,'lang'=>'java')
# new item ----- end

# plan/text
user_menu.menubutton_new.new_text_file.hint=New plan/text ..
user_menu.menubutton_new.new_text_file.caption= New plan/text file ..
# plain/text
user_menu.menubutton_new.new_text_file.hint=New plain text ..
user_menu.menubutton_new.new_text_file.caption= New plain text file ..
user_menu.menubutton_new.new_text_file.image_data=!FILE_ICON_TEXT
user_menu.menubutton_new.new_text_file.action=NewBufferEvent.new(self,'lang'=>'text')
# new item ----- end
Expand Down
19 changes: 5 additions & 14 deletions conf/arcadia.res.rb
Expand Up @@ -1738,19 +1738,10 @@
EOS

FILE_ICON_TCL=<<EOS
R0lGODlhEAAQAMZBAAAAAAQHBAUIFw4MAA8SHBscJCAgICQkGyYmJjw2Gzs3
KEg+FkM/IkdBG09HJlJIHlFJKUpNTVJSVlZaW15fZmFjbmFlXWNlb2Rmc2Vp
WmdpWXluPHlvQW1uc3FxcYx8OYp8QY1+PYx/RJCAOZGBNpaHQpyNSKaURKSb
ZbamXbiygLK0vM+3T9C7X7i5vrm6v7u6vbu8xNjEZdvHauDJZODMbeHMbcrK
y+XQbufRcNDQ0OXWgdncuvHgifXljv/wmP//3///////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
/////////////////////////////////////////////////yH+EUNyZWF0
ZWQgd2l0aCBHSU1QACH5BAEKAH8ALAAAAAAQABAAAAdlgH+Cg4MYDYSIgy4T
OyyJiC8MKC0Pj4QRPhsyCpaCHSohICkVnToAPwkzIyudFEAfIjYAnX8BPQA1
JRe0GTQOOAO0MBocECYEtBI8CzkkMbR/BxYnAtB/NwAF1oII24IG3n8etIEA
Ow==
R0lGODlhEAAQAMIFAAAAAPh4APjAAPj4APj4+P///////////yH+EUNyZWF0
ZWQgd2l0aCBHSU1QACH5BAEKAAcALAAAAAAQABAAAANAeLp88KC1FwKUCgRS
bZQAx3UfE4qdNRFsMLBEmcGEkMonK9CyA++wXg7I6vlqPEyIGMM4iA8nQAAx
LqZWUFaSAAA7
EOS


Expand Down Expand Up @@ -1973,4 +1964,4 @@
R0lGODlhDAAMAMIHACqM71N2iRokKnKWqhAWGYOjtJeywP///yH+EUNyZWF0
ZWQgd2l0aCBHSU1QACH5BAEAAAcALAAAAAAMAAwAAAMeeLrc/lAQQasVIGtN
ysFb1i0g5zHl6GDqQxhQLCsJADs=
EOS
EOS
28 changes: 13 additions & 15 deletions ext/ae-dir-projects/ae-dir-projects.rb
Expand Up @@ -51,38 +51,39 @@ def on_build(_event)
padx 0
pady 0
background Arcadia.conf('panel.background')
}.place('x'=>0,'height'=> 20)

}.place('x'=>0)
TkWinfo.parent(@button_box).configure(:background => Arcadia.conf('panel.background'))

@button_box.add(Arcadia.style('toolbarbutton').update({
'name'=>'new_proj',
'anchor' => 'nw',
'command'=>proc{self.do_new_project},
'helptext'=>'New dir Project',
'image'=> TkPhotoImage.new('dat' => NEW_GIF)})
'image'=> Arcadia.image_res(NEW_GIF)})
)

@button_box.add(Arcadia.style('toolbarbutton').update({
'name'=>'open_proj',
'anchor' => 'nw',
'command'=>proc{self.do_open_project},
'helptext'=>'Open dir as Project',
'image'=> TkPhotoImage.new('dat' => OPEN_PROJECT_GIF)})
'image'=> Arcadia.image_res(OPEN_PROJECT_GIF)})
)

@button_box.add(Arcadia.style('toolbarbutton').update({
'name'=>'parent_folder',
'anchor' => 'nw',
'command'=>proc{self.do_goto_parent_folder},
'helptext'=>'Go to parent folder',
'image'=> TkPhotoImage.new('dat' => PARENTFOLDER_GIF)})
'image'=> Arcadia.image_res(PARENTFOLDER_GIF)})
)

@button_box.add(Arcadia.style('toolbarbutton').update({
'name'=>'parent_folder',
'anchor' => 'nw',
'command'=>proc{self.do_search_files},
'helptext'=>'Search in files from current folder',
'image'=> TkPhotoImage.new('dat' => SEARCH_FILES_GIF)})
'image'=> Arcadia.image_res(SEARCH_FILES_GIF)})
)

#--- button_box
Expand All @@ -92,7 +93,7 @@ def on_build(_event)
justify 'left'
indicatoron 0
offrelief 'flat'
image TkPhotoImage.new('dat' => SYNC_GIF)
image Arcadia.image_res(SYNC_GIF)
pack
}

Expand Down Expand Up @@ -134,22 +135,19 @@ def on_build(_event)

do_open_folder_cmd = proc{|_node| do_open_folder(_node)}
do_close_folder_cmd = proc{|_node| do_close_folder(_node)}

# @htree = Tk::BWidget::Tree.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
@htree = BWidgetTreePatched.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
@htree = BWidgetTreePatched.new(self.frame.hinner_frame, Arcadia.style('treepanel')){
showlines false
deltay 18
opencmd do_open_folder_cmd
closecmd do_close_folder_cmd
selectcommand do_select_item
crosscloseimage TkPhotoImage.new('dat' => PLUS_GIF)
crossopenimage TkPhotoImage.new('dat' => MINUS_GIF)
crosscloseimage Arcadia.image_res(PLUS_GIF)
crossopenimage Arcadia.image_res(MINUS_GIF)
}
@htree.extend(TkScrollableWidget).show(0,22)
self.pop_up_menu_tree
@image_kdir = TkPhotoImage.new('dat' => ICON_FOLDER_OPEN_GIF)
#@image_kdir = TkPhotoImage.new('dat' => FOLDER2_GIF)
@image_kdir_closed = TkPhotoImage.new('dat' => FOLDER_GIF)
@image_kdir = Arcadia.image_res(ICON_FOLDER_OPEN_GIF)
@image_kdir_closed = Arcadia.image_res(FOLDER_GIF)
self.load_projects
@htree.areabind_append('KeyPress',proc{|k|
key_press(k)
Expand Down
92 changes: 66 additions & 26 deletions ext/ae-editor/ae-editor.rb
Expand Up @@ -809,7 +809,7 @@ def initialize(_controller)
justify 'left'
indicatoron 0
offrelief 'flat'
image TkPhotoImage.new('dat' => SYNC_GIF)
image Arcadia.image_res(SYNC_GIF)
pack
}
Tk::BWidget::DynamicHelp::add(@cb_sync,
Expand Down Expand Up @@ -939,8 +939,8 @@ def initialize_tree(_frame)
deltay 18
dragenabled true
selectcommand proc{ _tree_goto.call(self) }
crosscloseimage TkPhotoImage.new('dat' => ARROWRIGHT_GIF)
crossopenimage TkPhotoImage.new('dat' => ARROWDOWN_GIF)
crosscloseimage Arcadia.image_res(ARROWRIGHT_GIF)
crossopenimage Arcadia.image_res(ARROWDOWN_GIF)
}
@tree_exp.extend(TkScrollableWidget)
self.show
Expand All @@ -964,10 +964,10 @@ def hide
end

def build_tree_from_node(_node, _label_match=nil)
@image_class = TkPhotoImage.new('dat' => TREE_NODE_CLASS_GIF)
@image_module = TkPhotoImage.new('dat' => TREE_NODE_MODULE_GIF)
@image_method = TkPhotoImage.new('dat' => TREE_NODE_METHOD_GIF)
@image_singleton_method = TkPhotoImage.new('dat' => TREE_NODE_SINGLETON_METHOD_GIF)
@image_class = Arcadia.image_res(TREE_NODE_CLASS_GIF)
@image_module = Arcadia.image_res(TREE_NODE_MODULE_GIF)
@image_method = Arcadia.image_res(TREE_NODE_METHOD_GIF)
@image_singleton_method = Arcadia.image_res(TREE_NODE_SINGLETON_METHOD_GIF)

_sorted_sons = _node.sons.sort
for inode in 0.._sorted_sons.length - 1
Expand Down Expand Up @@ -1319,13 +1319,15 @@ def raise_complete_code(_candidates, _row, _col, _filter='')
else
_line = @text.get("insert linestart",'insert lineend')
ei = _line.index(_target)
j=1
pre_target = ''
while ei-j>=0 && _line[ei-j..ei-j]!="\s"
pre_target = _line[ei-j..ei-j] + pre_target
j+=1
end
_target= pre_target + _target
if !ei.nil?
j=1
pre_target = ''
while ei-j>=0 && _line[ei-j..ei-j]!="\s"
pre_target = _line[ei-j..ei-j] + pre_target
j+=1
end
_target= pre_target + _target
end
end
if _target.strip.length > 0 && _target != '.'
extra_len = _target.length.+@
Expand Down Expand Up @@ -2382,7 +2384,7 @@ def pop_up_menu
if _data.length > 0
_b = TkButton.new(@text,
'command'=>proc{_b.destroy},
'image'=> TkPhotoImage.new('data' => _data),
'image'=> Arcadia.image_res(_data),
'relief'=>'groove')
TkTextWindow.new(@text, _r[0][1], 'window'=> _b)
end
Expand Down Expand Up @@ -3399,19 +3401,44 @@ def initialize(_langs_conf)
end
def find_tag(_tag, _row, _txt)
def find_tag(_tag, _row, _line_txt)
_txt = _line_txt
to_ret = []
_re = @h_re[_tag]
m = _re.match(_txt)
_end = 0
# index = _line_txt.index("oldaccel1")
# stampa = index && index >0
# stampa=true
# p "_line_txt=#{_line_txt}" if stampa
# p "_tag=#{_tag}" if stampa
while m && (_txt=m.post_match)
if !defined?(_old_txt) || _txt != _old_txt
_old_txt = _txt
_ibegin = _row.to_s+'.'+(m.begin(0)+_end).to_s
_end = m.end(0) + _end
_iend = _row.to_s+'.'+(_end.to_s)
to_ret << [_ibegin, _iend]
if @op_only_first.include?(_tag)
b1 = _line_txt[m.begin(0)+_end-1..m.begin(0)+_end-1]
b2 = _line_txt[m.begin(0)+_end..m.begin(0)+_end]
e1 = _line_txt[m.end(0)+_end..m.end(0)+_end]
e2 = _line_txt[m.end(0)-1+_end..m.end(0)+_end-1]
achar = ["\s","\t","\n",nil,')',']','}','',':','=',">","<"]
ok = (achar.include?(b1)||achar.include?(b2)) && (achar.include?(e1)||achar.include?(e2))
ok = ok || _line_txt[m.begin(0)+_end..m.end(0)+_end-1].strip.length==1
# p "" if stampa
# p "_line_txt[m.begin(0)+_end..m.begin(0)+_end]=#{_line_txt[m.begin(0)+_end..m.begin(0)+_end]}" if stampa
# p "_line_txt[m.end(0)+_end..m.end(0)+_end]=#{_line_txt[m.end(0)+_end..m.end(0)+_end]}" if stampa
# p "_line_txt[m.begin(0)+_end..m.end(0)+_end]=#{_line_txt[m.begin(0)+_end..m.end(0)+_end]}" if stampa
# p "ok=#{ok}" if stampa
if ok
_old_txt = _txt
_ibegin = _row.to_s+'.'+(m.begin(0)+_end).to_s
_end = m.end(0) + _end
_iend = _row.to_s+'.'+(_end.to_s)
to_ret << [_ibegin, _iend]
end
if @op_only_first.include?(_tag) && ok
m = nil
else
m = _re.match(_txt)
Expand Down Expand Up @@ -3527,6 +3554,10 @@ class AgMultiEditor < ArcadiaExt
def on_before_build(_event)
Arcadia.is_windows? ? @ctags_string="lib/ctags.exe" : @ctags_string='ctags'
@has_ctags = !Arcadia.which(@ctags_string).nil?
if !@has_ctags
msg = "\"ctags\" package is required by class browsing, without it only ruby language is supported!"
ArcadiaProblemEvent.new(self, "type"=>ArcadiaProblemEvent::DEPENDENCE_MISSING_TYPE,"title"=>"Ctags missing!", "detail"=>msg).go!
end
@breakpoints =Array.new
@tabs_file =Hash.new
@tabs_editor =Hash.new
Expand Down Expand Up @@ -3681,7 +3712,7 @@ def add_buffer_menu_item(_filename, is_file=true)
if type != 'separator'
#label = @buffer_menu.entrycget(j,'label')
#if label > _filename
value = @buffer_menu.entrycget(j,'value')
value = @buffer_menu.entrycget(j,'value').to_s
if value > _filename
index=j
break
Expand Down Expand Up @@ -4052,14 +4083,19 @@ def on_buffer(_event)
@last_transient_file = nil
end
end
if _event.select_index.nil?
select_index = true
else
select_index = _event.select_index
end
if _event.file == '*CURR'
er = raised
if er && _index != nil
er.text_see(_index)
er.mark_selected(_index)
er.mark_selected(_index) if select_index
end
else
self.open_file(_event.file, _index)
self.open_file(_event.file, _index, select_index)
end
elsif _event.text
if _event.title
Expand All @@ -4076,7 +4112,7 @@ def on_buffer(_event)
self.open_file(_event.file)
end
when CloseBufferEvent
if _event.file
if _event.file
self.close_file(_event.file)
end
when SaveAsBufferEvent
Expand Down Expand Up @@ -4779,8 +4815,12 @@ def can_close_editor?(_editor)
def close_editor(_editor, _force=false)
if _force || can_close_editor?(_editor)
file = _editor.file
index = _editor.text.index("@0,0")
r,c = index.split('.')
_editor.destroy_outline
close_buffer(_editor.page_frame)
BufferClosedEvent.new(self,'file'=>file,'row'=>r.to_i, 'col'=>c.to_i).shot!
else
return
end
Expand Down
8 changes: 4 additions & 4 deletions ext/ae-editor/langs/conf.lang
@@ -1,14 +1,14 @@
scanner=re
language=conf
exts=conf,lang,pers,tokens
re.classes=key,value,operator,comment,link
re.classes=key,value,link,operator,comment
re.comment=#(.*)
re.key=(.*)\=
re.value=\=(.*)
re.operator=\=
re.comment=#
re.link=>>>
re_op.to_line_end=comment
re_op.only_first=operator
#re_op.to_line_end=comment
#re_op.only_first=operator

re.hightlight.comment.foreground=>>>hightlight.comment.foreground
re.hightlight.key.foreground=>>>hightlight.symbol.foreground
Expand Down

0 comments on commit 24ce20a

Please sign in to comment.