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

ASIC Integration Manager
Coolsand Technologies
___________________________________________