Home Download Buy Blog Forum Support

[BUG] CMD-D Repeat not working [OS X 2215]

[BUG] CMD-D Repeat not working [OS X 2215]

Postby planet on Fri Jul 20, 2012 10:44 am

Hi,
if have removed the "$" from my "word_separators" setting for PHP programming.

CMD-D now also selects the "$" when used on variables. However, pressing CMD-D again does not select the next instance of that variable anymore. If I select that variable via mouse, CMD-D (repeat) works as expected.

Regards, Thorsten.
planet
 
Posts: 25
Joined: Fri Feb 17, 2012 12:30 pm

Re: [BUG] CMD-D Repeat not working [OS X 2215]

Postby planet on Mon Feb 25, 2013 6:11 pm

I tried to find a workaround for this Problem (still present in ST3 and also documented here by somebody else http://sublimetext.userecho.com/topic/61252-find-whole-word-for-variables/). I came up with the following key-binding:

Code: Select all
{ "keys": ["super+d"], "command": "expand_selection", "args": {"to": "scope"}, "context":
        [
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_contains", "operand": "\\$", "match_all": true },
            { "key": "selector", "operator": "equal", "operand": "source.php" }
        ]
}


It works quite well for me. The regex could be optimized by only check for $ at the beginning of the current word, but I don't know if that is possible.

Greetings!
planet
 
Posts: 25
Joined: Fri Feb 17, 2012 12:30 pm

Re: [BUG] CMD-D Repeat not working [OS X 2215]

Postby certainlyakey on Wed Feb 05, 2014 5:43 pm

planet wrote:I tried to find a workaround for this Problem (still present in ST3 and also documented here by somebody else http://sublimetext.userecho.com/topic/61252-find-whole-word-for-variables/). I came up with the following key-binding:

Code: Select all
{ "keys": ["super+d"], "command": "expand_selection", "args": {"to": "scope"}, "context":
        [
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_contains", "operand": "\\$", "match_all": true },
            { "key": "selector", "operator": "equal", "operand": "source.php" }
        ]
}


It works quite well for me. The regex could be optimized by only check for $ at the beginning of the current word, but I don't know if that is possible.

Greetings!


Thank you for this workaround!
certainlyakey
 
Posts: 10
Joined: Sat Jul 06, 2013 10:15 am

Re: [BUG] CMD-D Repeat not working [OS X 2215]

Postby certainlyakey on Mon Feb 17, 2014 4:57 pm

planet wrote:I tried to find a workaround for this Problem (still present in ST3 and also documented here by somebody else http://sublimetext.userecho.com/topic/61252-find-whole-word-for-variables/). I came up with the following key-binding:

Code: Select all
{ "keys": ["super+d"], "command": "expand_selection", "args": {"to": "scope"}, "context":
        [
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_contains", "operand": "\\$", "match_all": true },
            { "key": "selector", "operator": "equal", "operand": "source.php" }
        ]
}


It works quite well for me. The regex could be optimized by only check for $ at the beginning of the current word, but I don't know if that is possible.

Greetings!


Thank you! This could be optimized at least by adding the "following_text" key, in this form it gave me multiple false selections:
Code: Select all
{ "keys": ["super+d"], "command": "expand_selection", "args": {"to": "scope"}, "context": [{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "\\$", "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "\\s", "match_all": true }, { "key": "selector", "operator": "equal", "operand": "source.php, source.scss" } ] },
certainlyakey
 
Posts: 10
Joined: Sat Jul 06, 2013 10:15 am


Return to Technical Support

Who is online

Users browsing this forum: diego898, Google [Bot] and 23 guests