~ubuntu-branches/ubuntu/saucy/monodevelop/saucy-proposed

« back to all changes in this revision

Viewing changes to src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2012-06-22 20:35:35 UTC
  • mfrom: (10.3.2)
  • Revision ID: package-import@ubuntu.com-20120622203535-zrozwvcf6kfk6l6i
Tags: 3.0.3.2+dfsg-1
* [3fd89ae] Imported Upstream version 3.0.3.2+dfsg
* [379a680] Remove old patches we haven't used for ages from git.
* [d71161d] Remove correct_paths_in_monodevelop-core-addins.pc.patch.
  Upstream claim to have fixed this by moving assembly install locations.
* [15dbfb9] Fix install location for MonoDevelop.Gettext.dll.config.
* [26eb434] Fix install location for MonoDevelop.SourceEditor2.dll.config.
* [4169974] Upstream commit 53282c9 which finally reconciles the 
  MonoDevelop.Gettext.dll install location with the 
  monodevelop-core-addins.pc location.

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
                        int startLine = (int)(textEditor.GetTextEditorData ().VAdjustment.Value / LineHeight);
185
185
                        int endLine = (int)(startLine + textEditor.GetTextEditorData ().VAdjustment.PageSize / LineHeight) + 1;
186
186
                        foreach (DocumentLine line in layoutDict.Keys) {
187
 
                                int curLine = Document.OffsetToLineNumber (line.Offset);
 
187
                                int curLine = line.LineNumber;
188
188
                                if (startLine - 5 >= curLine || endLine + 5 <= curLine) {
189
189
                                        linesToRemove.Add (line);
190
190
                                }
730
730
                                        DocumentLocation visStart = textEditor.LogicalToVisualLocation (start);
731
731
                                        DocumentLocation visEnd = textEditor.LogicalToVisualLocation (end);
732
732
                                        int lineOffset = line.Offset;
733
 
                                        int lineNumber = Document.OffsetToLineNumber (lineOffset);
 
733
                                        int lineNumber = line.LineNumber;
734
734
                                        if (textEditor.MainSelection.MinLine <= lineNumber && lineNumber <= textEditor.MainSelection.MaxLine) {
735
735
                                                selectionStart = lineOffset + line.GetLogicalColumn (this.textEditor.GetTextEditorData (), System.Math.Min (visStart.Column, visEnd.Column)) - 1;
736
736
                                                selectionEnd = lineOffset + line.GetLogicalColumn (this.textEditor.GetTextEditorData (), System.Math.Max (visStart.Column, visEnd.Column)) - 1;
1671
1671
                                        int lineNr = Document.OffsetToLineNumber (offset);
1672
1672
                                        textEditor.SetSelectLines (lineNr, lineNr);
1673
1673
 
 
1674
                                        var range = textEditor.SelectionRange;
 
1675
                                        mouseWordStart = range.Offset;
 
1676
                                        mouseWordEnd = range.EndOffset;
 
1677
 
1674
1678
                                        inSelectionDrag = true;
1675
1679
                                        mouseSelectionMode = MouseSelectionMode.WholeLine;
1676
1680
                                        return;
1713
1717
 
1714
1718
                                bool autoScroll = textEditor.Caret.AutoScrollToCaret;
1715
1719
                                textEditor.Caret.AutoScrollToCaret = false;
 
1720
                                if (selection != null && selectionRange.Contains (offset)) {
 
1721
                                        textEditor.ClearSelection ();
 
1722
                                        textEditor.Caret.Offset = selectionRange.EndOffset;
 
1723
                                        return;
 
1724
                                }
 
1725
 
1716
1726
                                int length = ClipboardActions.PasteFromPrimary (textEditor.GetTextEditorData (), offset);
1717
1727
                                textEditor.Caret.Offset = oldOffset;
1718
1728
                                if (selection != null) {
1719
1729
                                        if (offset < selectionRange.EndOffset) {
1720
 
                                                oldOffset += length;
1721
 
                                                anchor += length;
1722
 
                                                selection = new Selection (Document.OffsetToLocation (selectionRange.Offset + length),
1723
 
                                                                           Document.OffsetToLocation (selectionRange.Offset + length + selectionRange.Length));
 
1730
                                                textEditor.SelectionRange = new TextSegment (selectionRange.Offset + length, selectionRange.Length);
1724
1731
                                        }
1725
 
                                        textEditor.MainSelection = selection;
1726
1732
                                }
1727
1733
 
1728
1734
                                if (autoScroll)
1980
1986
                                //textEditor.SetSelectLines (loc.Line, textEditor.MainSelection.Anchor.Line);
1981
1987
                                DocumentLine line1 = textEditor.Document.GetLine (loc.Line);
1982
1988
                                DocumentLine line2 = textEditor.Document.GetLineByOffset (textEditor.SelectionAnchor);
1983
 
                                Caret.Offset = line1.Offset < line2.Offset ? line1.Offset : line1.EndOffsetIncludingDelimiter;
1984
 
                                if (textEditor.MainSelection != null)
 
1989
                                var o2 = line1.Offset < line2.Offset ? line1.Offset : line1.EndOffsetIncludingDelimiter;
 
1990
                                Caret.Offset = o2;
 
1991
                                if (textEditor.MainSelection != null) {
1985
1992
                                        textEditor.MainSelection.Lead = Caret.Location;
 
1993
                                        if (mouseWordStart < o2) {
 
1994
                                                textEditor.MainSelection.Anchor = textEditor.OffsetToLocation (mouseWordStart);
 
1995
                                        } else {
 
1996
                                                textEditor.MainSelection.Anchor = textEditor.OffsetToLocation (mouseWordEnd);
 
1997
 
 
1998
                                        }
 
1999
                                }
 
2000
 
1986
2001
                                break;
1987
2002
                        }
1988
2003
                        Caret.PreserveSelection = false;
2228
2243
 
2229
2244
                                        if (folding.EndLine != line) {
2230
2245
                                                line = folding.EndLine;
2231
 
                                                lineNr = Document.OffsetToLineNumber (line.Offset);
 
2246
                                                lineNr = line.LineNumber;
2232
2247
                                                foldings = Document.GetStartFoldings (line);
2233
2248
                                                isEolFolded = line.Length <= folding.EndColumn;
2234
2249
                                                goto restart;
2284
2299
                                                lineArea.Height);
2285
2300
                                        } else {
2286
2301
                                                // prevent "gaps" in the selection drawing ('fuzzy' lines problem)
2287
 
                                                lineArea = new Cairo.Rectangle (pangoPosition / Pango.Scale.PangoScale - 1,
 
2302
                                                lineArea = new Cairo.Rectangle (System.Math.Max (pangoPosition / Pango.Scale.PangoScale - 1, XOffset + TextStartPosition),
2288
2303
                                                lineArea.Y,
2289
2304
                                                textEditor.Allocation.Width - pangoPosition / Pango.Scale.PangoScale + 1,
2290
2305
                                                lineArea.Height);
2645
2660
                                        continue;
2646
2661
                                return extendingTextMarker.GetLineHeight (textEditor);
2647
2662
                        }
2648
 
                        int lineNumber = textEditor.OffsetToLineNumber (line.Offset); 
 
2663
                        int lineNumber = line.LineNumber; 
2649
2664
                        var node = textEditor.GetTextEditorData ().HeightTree.GetNodeByLine (lineNumber);
2650
2665
                        if (node == null)
2651
2666
                                return LineHeight;