MantisBT - mSLDev
View Issue Details
0000121mSLDevAutoCompletepublic2013-04-04 20:062013-04-13 02:38
Wims 
administrator 
normalminorN/A
closedwon't fix 
 
0.4.1.0 
0000121: change a bit how the auto completion adds the ) for an $iden( and put the cursor in the middle
supposing you have the following line:

alias name return |1000

where | is the cursor.

1) type $calc( and you get:

alias name return $calc(|)1000

which is not really nice as you can imagine.
I suggest it grabs the first next 'token' and puts the cursor like this:

alias name return $calc(1000|)

furthermore, the behavior could be extended like this:

after the completion by grabing the first next token, if we hold a key like shift and use the arrow keys left or right, we can move the cursor and the ) to choose up to which part of the line you want to apply the $identifier, that would be really handy:

1) alias name return |1000 / 25 * 100 % 2

2) you type $calc(, you get:

   alias name return $calc(1000|) / 25 * 100 % 2

3) you hold shift and hit the right arrow key, you get:

   alias name return $calc(1000 /|) 25 * 100 % 2

4) repeat 3) to quickly get :

  alias name return $calc(1000 / 25 * 100 % 2|)

left arrow key to move backward.
and if we are at the last token, put the cursor after the ')'.

No tags attached.
Issue History
2013-04-04 20:06WimsNew Issue
2013-04-13 02:26administratorNote Added: 0000082
2013-04-13 02:38administratorNote Edited: 0000082bug_revision_view_page.php?bugnote_id=82#r59
2013-04-13 02:38administratorStatusnew => closed
2013-04-13 02:38administratorAssigned To => administrator
2013-04-13 02:38administratorResolutionopen => won't fix
2013-04-13 02:38administratorFixed in Version => 0.4.1.0

Notes
(0000082)
administrator   
2013-04-13 02:26   
(edited on: 2013-04-13 02:38)
There are too many issues:

$calc(| $foobar( )

Will now become:

$calc( $foobar() )

Nested idents will cause even bigger issues:

$foobar( $calc(| ,bar ,baz)

$foobar( $calc(| ,bar) ,baz)

Overall the chances that the next token is actually part of the ident is unlikely in practice.

Disable the auto ) auto-complete if it annoys you.