Code Templates key word-boundary issue

Started by Stefan, March 17, 2009, 12:07:22 PM

Previous topic - Next topic

Stefan

Code Templates key word- boundary issue

Just FYI


I have an code template key like "IT".
But this is triggered also if i type "testIT"  (see pic), which is not expected as i guess? 

Should i use something like  "_IT"  as key?
An key like " IT" is no solution. (EDIT: no, it IS an solution too, since this key is replaced by template.)
I think your code should use something like "\b{key}"?

On the other side this issue could be an welcome feature too! if someone needs this.

.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

This is not always correct, because as template you can use any character sequence (::: or ;; what ever), which are should be boundered by word symbols.

But possible solution for me would be to check that template starts with word symbol or not and use appropriate logic. Would try to correct this newxt beta.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

Beta 1.42 Build 637

The logic is modified. For my example above this works now as expected.
The code template is only triggered if the trigger key is typed as single word (key) and not as last past of an wort (wordkey)
The only exception is, if you start tipping at col 1 and type an addition single char in front (ckey) of trigger key.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

QuoteThe only exception is, if you start tipping at col 1 and type an addition single char in front (ckey) of trigger key.
This is a bug. Would correct it next beta.

Thanks a lof for retest!
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

#4
Beta 1.42 Build 637

Sorry Alex, another one:


While modifying the case from "Wscript" to "WScript"  my trigger-key "WS" is triggered. (see pic)

Of course i didn't have to press ENTER or TAB, but... it's not nice the tool tip appears in this situation.

QuoteExplanation:

I had this code:
Wscript.Quit
End If

After changing "Wscript" to "WScript" and pressing ENTER i got this code:
Dim WS
set WS = CreateObject("wscript.Shell")cript.Quit
End If


So i think we need to check if there are chars behind too?
What i mean is: the trigger "WS" should not be detected in such situation, the tool tip should not appear and
even i press ENTER or TAB the template should not be inserted.

Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Here I am not sure.

Because I have checked another engines (Visual Assist), and see that HE behaves same i nthis case.
But maybe this can be limited to case when next symbol is alphabetic and last char of template is also alphabetic.
Because  I do not know that W was typed before for HE and could not use this info.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]