Bug 256014

Summary: Allow one script trigger to be a prefix of another
Product: [Applications] kile Reporter: Misha Aizatulin <avatar>
Component: generalAssignee: Michel Ludwig <michel.ludwig>
Status: REPORTED ---    
Severity: wishlist CC: avatar
Priority: NOR    
Version First Reported In: 2.0.85   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Misha Aizatulin 2010-11-04 03:50:22 UTC
Version:           2.0.85 (using KDE 4.4.4) 
OS:                Linux

I am using Kile scripts for autocompletion: Entering "{" results in input of "{}" with (very importantly!) cursor being placed between the braces. The same way I would like entering "\{" to produce "\{\}" with the cursor placed in the middle. Unfortunately, right now this is not possible - the shorter sequence always takes precedence. My suggestion would be to reverse the rule and allow the longer (more specific) sequence to be tried first.

Reproducible: Always

Steps to Reproduce:
Add two scripts:

var doc = kile.currentTextDocument();
doc.insertText("{}");
var i = doc.cursorColumn();
doc.setCursorColumn(i - 1);

and 

var doc = kile.currentTextDocument();
doc.insertText("\{\}");
var i = doc.cursorColumn();
doc.setCursorColumn(i - 2);

Assign the trigger "{" to the first one and the trigger "\{" to the second one. Now type "\{". 

Actual Results:  
\{}

Expected Results:  
\{\}
Comment 1 Misha Aizatulin 2019-10-17 22:19:07 UTC
Looks like this is still an issue with 2.9.92.

In fact, now the issue is worse -  neither "\{" nor "\\{" as triggers work at all, I presume due to it being confused about escaping.