Browse Source

Fixed SD2-1142: Indentation removes comments in VB code.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1925 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
70a9f05362
  1. 6
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/FormattingStrategy/VBNetFormattingStrategy.cs
  2. 10
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/HRuler.cs
  3. 1
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs
  4. 7
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs

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

@ -148,8 +148,10 @@ namespace VBNetBinding.FormattingStrategy @@ -148,8 +148,10 @@ namespace VBNetBinding.FormattingStrategy
for (int i = 0; i < statement.IndentPlus; ++i) {
RemoveIndent(b);
}
if (doCasing && !statement.EndStatement.EndsWith(" "))
curLineText = statement.EndStatement;
// We cannot reset curLineText like this - it would remove
// comments after the EndStatement, see SD2-1142
//if (doCasing && !statement.EndStatement.EndsWith(" "))
// curLineText = statement.EndStatement;
matched = true;
}
if (Regex.IsMatch(texttoreplace, statement.StartRegex, RegexOptions.IgnoreCase)) {

10
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/HRuler.cs

@ -12,11 +12,11 @@ using System.Windows.Forms; @@ -12,11 +12,11 @@ using System.Windows.Forms;
namespace ICSharpCode.TextEditor
{
/// <summary>
/// Description of HRuler.
/// Horizontal ruler - text column measuring ruler at the top of the text area.
/// </summary>
public class HRuler : UserControl
public class HRuler : Control
{
TextArea textArea;
TextArea textArea;
public HRuler(TextArea textArea)
{
@ -49,10 +49,6 @@ namespace ICSharpCode.TextEditor @@ -49,10 +49,6 @@ namespace ICSharpCode.TextEditor
0,
Width,
Height));
}
}
}

1
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs

@ -547,6 +547,7 @@ namespace ICSharpCode.TextEditor @@ -547,6 +547,7 @@ namespace ICSharpCode.TextEditor
return false;
}
// Fixes SD2-747: Form containing the text editor and a button with a shortcut
protected override bool IsInputChar(char charCode)
{
return true;

7
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs

@ -632,6 +632,7 @@ namespace ICSharpCode.TextEditor @@ -632,6 +632,7 @@ namespace ICSharpCode.TextEditor
// split words after 1000 characters. Fixes GDI+ crash on very longs words, for example
// a 100 KB Base64-file without any line breaks.
const int MaximumWordLength = 1000;
const int MaximumCacheSize = 2000;
int MeasureStringWidth(Graphics g, string word, Font font)
{
@ -652,7 +653,7 @@ namespace ICSharpCode.TextEditor @@ -652,7 +653,7 @@ namespace ICSharpCode.TextEditor
if (measureCache.TryGetValue(new WordFontPair(word, font), out width)) {
return width;
}
if (measureCache.Count > 1000) {
if (measureCache.Count > MaximumCacheSize) {
measureCache.Clear();
}
@ -661,11 +662,15 @@ namespace ICSharpCode.TextEditor @@ -661,11 +662,15 @@ namespace ICSharpCode.TextEditor
// txt.GetPositionFromCharIndex(txt.SelectionStart)
// (Verdana 10, highlighting makes GetP... bold) -> note the space between 'x' and '('
// this also fixes "jumping" characters when selecting in non-monospace fonts
// [...]
// Replaced GDI+ measurement with GDI measurement: faster and even more exact
width = TextRenderer.MeasureText(g, word, font, new Size(short.MaxValue, short.MaxValue), textFormatFlags).Width;
measureCache.Add(new WordFontPair(word, font), width);
return width;
}
// Important: Some flags combinations work on WinXP, but not on Win2000.
// Make sure to test changes here on all operating systems.
const TextFormatFlags textFormatFlags =
TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix | TextFormatFlags.PreserveGraphicsClipping;
#endregion

Loading…
Cancel
Save