I am trying to remove whitespace at the beginning of a tabstop using transformations. I have found that the regex \S+
should return all characters that aren't whitespace.
snippet getset "Create a get/set pair" b
${1:type} get${2:name}(){ return ${2/.*/\l$0/}; }
void set$2(${1/(\S+)/$0/g} new$2){ ${2/.*/\l$0/} = new$2; }
endsnippet
The regex that makes trouble is in the third line. I always get back the entire unaltered tabstop, including the whitespace, no matter that the regex is. I've tried (a)
and I still got the entire tabstop back:
arma::vec3 getname(){ return name; }
void setname( arma::vec3 newname){ name = newname; }
Are there any obvious things I am missing, or did I stumble upon a bug?