Browse Source

Fixed forum-6486 (Auto-correction occurring within strings)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2974 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
08cba8fe9e
  1. 5
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs
  2. 2
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerResourceService.cs

5
src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs

@ -317,14 +317,15 @@ namespace VBNetBinding.FormattingStrategy @@ -317,14 +317,15 @@ namespace VBNetBinding.FormattingStrategy
if (ch == '\n' && lineAboveText != null)
{
// remove comments
string texttoreplace = Regex.Replace(lineAboveText, "'.*$", "", RegexOptions.Singleline);
string texttoreplace = lineAboveText;
// remove string content
MatchCollection strmatches = Regex.Matches(texttoreplace, "\"[^\"]*?\"", RegexOptions.Singleline);
foreach (Match match in strmatches)
{
texttoreplace = texttoreplace.Remove(match.Index, match.Length).Insert(match.Index, new String('-', match.Length));
}
// remove comments
texttoreplace = Regex.Replace(texttoreplace, "'.*$", "", RegexOptions.Singleline);
if (doCasing)
{

2
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerResourceService.cs

@ -254,7 +254,7 @@ namespace ICSharpCode.FormsDesigner.Services @@ -254,7 +254,7 @@ namespace ICSharpCode.FormsDesigner.Services
newFileProjectItem.DependentUpon = Path.GetFileName(formFileName);
newFileProjectItem.Include = FileUtility.GetRelativePath(project.Directory, resourceFileName);
ProjectService.AddProjectItem(project, newFileProjectItem);
FileService.FireFileCreated(resourceFileName);
FileService.FireFileCreated(resourceFileName, false);
PadDescriptor pd = WorkbenchSingleton.Workbench.GetPad(typeof(ProjectBrowserPad));
FileNode formFileNode = ((ProjectBrowserPad)pd.PadContent).ProjectBrowserControl.FindFileNode(formFileName);

Loading…
Cancel
Save