Skip to content

Commit

Permalink
Move declarations closer to usage
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes committed Jul 5, 2018
1 parent c3d863f commit e9778c8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Project/Src/Gui/GutterMargin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,12 @@ public override void Paint(Graphics g, Rectangle rect)

public override void HandleMouseDown(Point mousepos, MouseButtons mouseButtons)
{
TextLocation selectionStartPos;

textArea.SelectionManager.selectFrom.where = WhereFrom.Gutter;
var realline = textArea.TextView.GetLogicalLine(mousepos.Y);
if (realline >= 0 && realline < textArea.Document.TotalNumberOfLines)
{
// shift-select
TextLocation selectionStartPos;
if ((Control.ModifierKeys & Keys.Shift) != 0)
{
if (!textArea.SelectionManager.HasSomethingSelected && realline != textArea.Caret.Position.Y)
Expand Down
3 changes: 1 addition & 2 deletions Project/Src/Gui/TextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,11 @@ private int PaintLinePart(Graphics g, int lineNumber, int startColumn, int endCo

var currentWordOffset = 0; // we cannot use currentWord.Offset because it is not set on space words

TextWord currentWord;
TextWord nextCurrentWord = null;
var fontContainer = TextEditorProperties.FontContainer;
for (var wordIdx = 0; wordIdx < currentLine.Words.Count; wordIdx++)
{
currentWord = currentLine.Words[wordIdx];
var currentWord = currentLine.Words[wordIdx];
if (currentWordOffset < startColumn)
{
// TODO: maybe we need to split at startColumn when we support fold markers
Expand Down
2 changes: 1 addition & 1 deletion Project/Src/Util/FileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ private static StreamReader AutoDetect(Stream fs, byte firstByte, byte secondByt
const int UTF8Sequence = 3;
var state = ASCII;
var sequenceLength = 0;
byte b;
for (var i = 0; i < max; i++)
{
byte b;
if (i == 0)
b = firstByte;
else if (i == 1)
Expand Down
3 changes: 1 addition & 2 deletions Project/Src/Util/TipPainter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ private static Rectangle GetWorkingArea(Control control)
public static Size GetTipSize(Control control, Graphics graphics, TipSection tipData)
{
var tipSize = Size.Empty;
SizeF tipSizeF;

RectangleF workingArea = GetWorkingArea(control);

Expand All @@ -51,7 +50,7 @@ public static Size GetTipSize(Control control, Graphics graphics, TipSection tip
TextRenderingHint.AntiAliasGridFit;

tipData.SetMaximumSize(maxLayoutSize);
tipSizeF = tipData.GetRequiredSize();
var tipSizeF = tipData.GetRequiredSize();
tipData.SetAllocatedSize(tipSizeF);

tipSizeF += new SizeF(
Expand Down

0 comments on commit e9778c8

Please sign in to comment.