Guys,
I'm trying to create a completion command for the C language, using D2. For that purpose, I wrote a function using TextMate::UI.complete. It looks almost like that:
#!/usr/bin/env ruby
require ENV['TM_SUPPORT_PATH'] + '/lib/web_preview.rb' require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb' require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'
currentWord = ENV['TM_CURRENT_WORD']
# Build the list of completion choice. choices = [{'display' => 'hal_Aa'}, {'display' => 'hal_Ab'}, {'display' => 'hal_Abc'}]
# Display the completion popup. options = {:extra_chars => '_', :case_insensitive => false} TextMate::UI.complete(choices, options)
When I call this TM command, it works fine, but pressing the '_' key, while the popup is displayed closes it and cancels the completion. This is not the behavior I expect as '_' has been added to the extra chars.
Does someone know how to have the '_' character being considered as part of the word?
BTW, in my preferences, the "Word Characters" field is "_". I don't know if this impacts.
Best regards, Mathieu
___________________________________________
Mathieu Godart
Skype: mathieu_godart MSN: mathieu_godart@hotmail.com
ASIC Integration Manager Coolsand Technologies ___________________________________________
On 18 Mar 2009, at 17:38, Mathieu Godart wrote:
[...] When I call this TM command, it works fine, but pressing the '_' key, while the popup is displayed closes it and cancels the completion. This is not the behavior I expect as '_' has been added to the extra chars.
Works fine for me.
BTW, in my preferences, the "Word Characters" field is "_". I don't know if this impacts.
It does not matter.