Hello,
I like the code snippets plugin and would like to suggest a small change. If you have a snippet, that consists of multiple lines, the content from the second line on isn't indented. I've looked into the code of the abbreviation feature, how to support indentation. The code snippets plugin needs one additional line of code only (in the method CodeSnippetsWindow::ApplySnippet before ctrl->AddText(snippet);):snippet.Replace(wxT("\n"), wxT('\n') + editor->GetLineIndentString(ctrl->GetCurrentLine()));
It would be nice, if that could be added.
Thank you.
If you insert the same snippet after a couple of tabs the snippet won't maintain it's tab structure. The first switch block below is correct as it has been inserted at the first column. It is exactly the same as the original snippet template (no indentation applied).
switch ()
{
case :
break;
default:
break;
}
The next snippet is inserted after two tabs but the tab structure is incorrect - only the first line is indented. The snippet has just been pasted with the same tabs it had in the original template (no indentation applied). This is awkward as most code has some level of indentation.
switch ()
{
case :
break;
default:
break;
}
With the change wxLearner has suggested the existing indentation level is automatically applied to the whole snippet so the block will match it's surrounding code.
switch ()
{
case :
break;
default:
break;
}