Skip to content

Commit

Permalink
working cmi search command
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.textmate.org/trunk/Bundles/OCaml Experimental Completions.tmbundle@6527 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information
David Powers committed Feb 4, 2007
1 parent 716412b commit cd87869
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Commands/Search _cmi.tmCommand
Expand Up @@ -12,14 +12,23 @@ require "#{ENV['TM_SUPPORT_PATH']}/lib/plist"
searchstring = $stdin.read.strip searchstring = $stdin.read.strip
plist = "{ignoreCase = 0; regularExpression = 0; searchString = \"#{searchstring}\"; }" plist = "{ignoreCase = 0; regularExpression = 0; searchString = \"#{searchstring}\"; restrictTo = \"all\";}"
options = `'#{ENV['TM_SUPPORT_PATH']}/bin/tm_dialog' -p '#{plist}' -m '#{ENV['TM_BUNDLE_SUPPORT']}/nibs/SearchWindow.nib' | pl` options = `'#{ENV['TM_SUPPORT_PATH']}/bin/tm_dialog' -p '#{plist}' -m '#{ENV['TM_BUNDLE_SUPPORT']}/nibs/SearchWindow.nib' | pl`
options = PropertyList.load(options) options = PropertyList.load(options)
if options['returnButton'] == 'Search' if options['returnButton'] == 'Search'
answers = OCamlCompletion::cmigrep(options['searchString']) searchtype = options['restrictTo'].to_sym
puts answers searchstring = options['searchString']
if options['regularExpression'] != 1
searchstring = Regexp.escape(searchstring)
end
answers = OCamlCompletion::cmigrep(searchstring, searchtype)
if answers != ''
puts answers
else
puts 'No matches found'
end
end</string> end</string>
<key>fallbackInput</key> <key>fallbackInput</key>
<string>word</string> <string>word</string>
Expand Down
Binary file modified Support/nibs/SearchWindow.nib/keyedobjects.nib
Binary file not shown.

0 comments on commit cd87869

Please sign in to comment.