Community
Participate
Working Groups
I'm using CDT 8.0.0.201108031635 1. Create a template containing ${word_selection} 2. Use the template on a word on a line that starts with some white space 3. Extra white space is inserted Note: It doesn't seem to matter if the "Use code formatter" option is checked or not. Example: template : ${word_selection} int main() { return 0; } When template is used on 'return': int main() { return 0; }
Created attachment 209182 [details] Remove white space when using ${word_selection} template
(In reply to comment #1) > Created attachment 209182 [details] > Remove white space when using ${word_selection} template Thanks for looking at this. I don't think trim will give the best results. Here's an example: template: cout << "${word_selection}" code: foo ; ^ ^ note the 4 spaces before and 4 spaces after foo. Select foo and the 4 subsequent spaces (up to ; but ; not selected). Invoke the template: white space is inserted before the cout and white space is lost after 'foo'. Also, if I test the original example, it still inserts spaces. Make sure you select only 'return' without the white spaces before it.