<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Guys,</div><div><br></div><div>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:</div><div><br></div><div><div><div><i>#!/usr/bin/env ruby</i></div><div><i><br></i></div><div><i>require ENV['TM_SUPPORT_PATH'] + '/lib/web_preview.rb'</i></div><div><i>require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb'</i></div><div><i>require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'</i></div><div><i><br></i></div><div><i>currentWord = ENV['TM_CURRENT_WORD']</i></div><div><i><br></i></div><div><i># Build the list of completion choice.</i></div><div><i>choices = [{'display' => 'hal_Aa'}, {'display' => 'hal_Ab'}, {'display' => 'hal_Abc'}]</i></div><div><i><br></i></div><div><i># Display the completion popup.</i></div><div><i>options = {:extra_chars => '_', :case_insensitive => false}</i></div><div><i>TextMate::UI.complete(choices, options)</i></div><div><br></div></div></div><div>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.</div><div><br></div><div>Does someone know how to have the '_' character being considered as part of the word?</div><div><br></div><div>BTW, in my preferences, the "Word Characters" field is "_". I don't know if this impacts.</div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Georgia; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><div><div><div><div>Best regards,</div><div>Mathieu</div><div><br></div><div>___________________________________________</div><div><br></div><div>Mathieu Godart</div><div><br></div><div>Skype: mathieu_godart</div><div>MSN: <a href="mailto:mathieu_godart@hotmail.com">mathieu_godart@hotmail.com</a></div><div><br></div><div><div>ASIC Integration Manager</div><div>Coolsand Technologies</div></div><div>___________________________________________</div><div><br></div></div></div></div></div></div></div></div></span></div></span></div></span><br class="Apple-interchange-newline"> </div><br></body></html>