Bug 2100 - Pressing ; to format code seriously messes up
Summary: Pressing ; to format code seriously messes up
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 2.8.2
Hardware: PC Windows
: Highest normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2011-11-20 14:48 UTC by Paul Sanders
Modified: 2011-11-24 09:29 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Paul Sanders 2011-11-20 14:48:55 UTC
Description of Problem:


Steps to reproduce the problem:
1. Go to the codeeditor that has some method. Choose a line of code that is not correctly formatted. Go to the end of the line and delete the ;

2. Press ; to kick off the formatting
Affects multiple lines, and adds in arbitrary spaces


Original Code:
	public MainWindow () : base(Gtk.WindowType.Toplevel)
	{
		LoadSettings();

		Build ();
		
		SetEditFont();
		txt.Buffer.Changed += new EventHandler(OnTextChanged);
	
		base.DeleteEvent += delegate {
			ValidateToSave();
			SaveSettings();
		};
		
		if(settings.ContainsKey("restoreFile") && settings.GetString("filename") != "")
		{
			if(settings.GetBool("restoreFile"))
			{
				OpenFile(settings.GetString("filename"));
				RestoreLastFileAction.Active=true;
			}
		}
		else
		{
			New();
		}
	}


Deleted ; on line	RestoreLastFileAction.Active=true;
and added it back.


Updated Code:
public MainWindow () : base(Gtk.WindowType.Toplevel)
	{
		LoadSetting s();

		Build ();
		
		SetEditFon t();
		txt.Buffer.Changed += new EventHandle r(OnTextChanged);
	
		base.DeleteEvent += delegate {
			ValidateToSav e();
			SaveSetting s();
		};
		
		i f(settings.ContainsKe y("restoreFile") && settings.GetStrin g("filename") != ""
			{
			 if(settings.GetBo ol("restoreFile"
					{
				OpenF ile(settings.GetStr ing("filename"));
				RestoreLastFileAction.Act i ve=true;
			}
		}
		else
		{
			New();
		}
	}


How often does this happen? 
Every time

Additional Information:
Also have issues when opening/closing code block by pressing { or }

I'm getting this so often, it's barely useable.
Comment 1 Mike Krüger 2011-11-24 09:29:47 UTC
fixed in master.