Skip to content

Commit

Permalink
Made ui.rb backwards compatible as well
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimm committed Jan 18, 2009
1 parent f95005d commit bdf81d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion objc_completion2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ def pop_up(candidates, searchTerm,star,arg_name)
flags[:extra_chars]= '_'
flags[:initial_filter]= searchTerm
begin
TextMate::UI.complete(pl, flags) do |hash|
TextMate::UI.complete(pl, flags, nil) do |hash|
es = ExternalSnippetizer.new({:star => star,
:arg_name => arg_name,
:tm_C_pointer => ENV['TM_C_POINTER']})
Expand Down
14 changes: 8 additions & 6 deletions ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ def complete(choices, options = {}, docTool = nil, &block) # :yields: choice
command << " --displayDocumentation"
::IO.popen(command, 'w+') do |io|
io << ( plist.to_plist + "\0")
#io.putc 0
to_insert = handleSelections(io, docTool, block)
end
else
::IO.popen(command, 'w+') do |io|
io << plist.to_plist
io.close_write
result = OSX::PropertyList.load io rescue nil

result = OSX::PropertyList.load io rescue nil
end
end
else
Expand All @@ -213,11 +213,13 @@ def complete(choices, options = {}, docTool = nil, &block) # :yields: choice
choice ? choice['insert'] : nil
end

# The block should return the text to insert as a snippet
to_insert << block.call(result).to_s
unless docTool
# The block should return the text to insert as a snippet
to_insert << block.call(result).to_s
# Insert the snippet if necessary

# Insert the snippet if necessary
#{}`"$DIALOG" x-insert --snippet #{e_sh to_insert}` unless to_insert.empty?
`"$DIALOG" x-insert --snippet #{e_sh to_insert}` unless to_insert.empty?
end
end
end

Expand Down

0 comments on commit bdf81d6

Please sign in to comment.