Compared files  

Left
C:\SDK\wxWidgets-2.6.2\contrib\src\stc\scintilla\src\Editor.cxx
Last modified2005-05-31 22:46:48.001 +0200
Size204.3 Kb (7112 Lines)
EncodingLatin 1 - ANSI (CP1252) default
Right
C:\SDK\wxWidgets-2.6.3\contrib\src\stc\scintilla\src\Editor.cxx
Last modified2006-03-16 13:07:06.001 +0100
Size206.2 Kb (7231 Lines)
EncodingLatin 1 - ANSI (CP1252) default


   Comparison Statistics  

Detailed Statistics

All Changes
 BlocksLines
Unchanged1276886
Inserted45162
Deleted950
Ignored00
Changed72359



   Comparison Details  

28 skipped lines
29U29U#include "Document.h"
30U30U#include "Editor.h"
31U31U 
  32A/*
  33A    return whether this modification represents an operation that
  34A    may reasonably be deferred (not done now OR [possibly] at all)
  35A*/
  36Astatic bool CanDeferToLastStep(const DocModification& mh) {
21 skipped lines
  58A        && (mh.modificationType & SC_MULTISTEPUNDOREDO) != 0
  59A        && (mh.modificationType & SC_LASTSTEPINUNDOREDO) != 0
  60A        && (mh.modificationType & SC_MULTILINEUNDOREDO) != 0;
  61A}
  62A 
32U63UCaret::Caret() :
33U64Uactive(false), on(false), period(500) {}
34U65U 
19 skipped lines
54U85U    edgeColumn(0),
55U86U    chars(0),
56U87U    styles(0),
  88A    styleBitsSet(0),
57U89U    indicators(0),
58U90U    positions(0),
59U91U    hsStart(0),
97 skipped lines
157U189U 
158U190ULineLayoutCache::LineLayoutCache() :
159U191U    level(0), length(0), size(0), cache(0),
160C    allInvalidated(false), styleClock(-1) { 192C    allInvalidated(false), styleClock(-1), useCount(0) {
161U193U    Allocate(0);
162U194U}
163U195U 
2 skipped lines
166U198U}
167U199U 
168U200Uvoid LineLayoutCache::Allocate(int length_) {
  201A    PLATFORM_ASSERT(cache == NULL);
169U202U    allInvalidated = false;
170U203U    length = length_;
171U204U    size = length;
8 skipped lines
180U213U}
181U214U 
182U215Uvoid LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
  216A    PLATFORM_ASSERT(useCount == 0);
183U217U    int lengthForLevel = 0;
184U218U    if (level == llcCaret) {
185U219U        lengthForLevel = 1;
4 skipped lines
190U224U    }
191U225U    if (lengthForLevel > size) {
192U226U        Deallocate();
193R    } else if (lengthForLevel < length) {  
194R        for (int i = lengthForLevel; i < length; i++) {  
195R        delete cache[i];  
196R        cache[i] = 0;  
197R        }  
198R    }  
199R    if (!cache) {  
200U227U        Allocate(lengthForLevel);
  228A    } else {
  229A        if (lengthForLevel < length) {
  230A        for (int i = lengthForLevel; i < length; i++) {
  231A        delete cache[i];
  232A        cache[i] = 0;
  233A        }
  234A        }
  235A        length = lengthForLevel;
201U236U    }
  237A    PLATFORM_ASSERT(length == lengthForLevel);
  238A    PLATFORM_ASSERT(cache != NULL || length == 0);
202U239U}
203U240U 
204U241Uvoid LineLayoutCache::Deallocate() {
  242A    PLATFORM_ASSERT(useCount == 0);
205U243U    for (int i = 0; i < length; i++)
206U244U        delete cache[i];
207U245U    delete []cache;
208U246U    cache = 0;
209U247U    length = 0;
  248A    size = 0;
210U249U}
211U250U 
212U251Uvoid LineLayoutCache::Invalidate(LineLayout::validLevel validity_) {
31 skipped lines
244U283U        pos = 0;
245U284U    } else if (level == llcPage) {
246U285U        if (lineNumber == lineCaret) {
247C        pos length; 286C        pos 0;
248U287U        } else {
249C        pos = lineNumber % length; 288C        pos 1 + (lineNumber % (length - 1));
250U289U        }
251U290U    } else if (level == llcDocument) {
252U291U        pos = lineNumber;
253U292U    }
254U293U    if (pos >= 0) {
  294A        PLATFORM_ASSERT(useCount == 0);
255U295U        if (cache && (pos < length)) {
256U296U        if (cache[pos]) {
257U297U        if ((cache[pos]->lineNumber != lineNumber) ||
9 skipped lines
267U307U        cache[pos]->lineNumber = lineNumber;
268U308U        cache[pos]->inCache = true;
269U309U        ret = cache[pos];
  310A        useCount++;
270U311U        }
271U312U        }
272U313U    }
11 skipped lines
284U325U    if (ll) {
285U326U        if (!ll->inCache) {
286U327U        delete ll;
287C        } 328C        } else {
  329C        useCount--;
  330C      }
288U331U    }
289U332U}
290U333U 
53 skipped lines
344U387U    scrollWidth = 2000;
345U388U    verticalScrollBarVisible = true;
346U389U    endAtLastLine = true;
  390A    caretSticky = false;
347U391U 
348U392U    pixmapLine = Surface::Allocate();
349U393U    pixmapSelMargin = Surface::Allocate();
11 skipped lines
361U405U    topLine = 0;
362U406U    posTopLine = 0;
363U407U 
364C    lengthForEncode = 0; 408C    lengthForEncode = -1;
365U409U 
366U410U    needUpdateUI = true;
367U411U    braces[0] = invalidPosition;
24 skipped lines
392U436U    wrapVisualStartIndent = 0;
393U437U    actualWrapVisualStartIndent = 0;
394U438U 
  439A    convertPastes = true;
  440A 
395U441U    hsStart = -1;
396U442U    hsEnd = -1;
397U443U 
22 skipped lines
420U466U    pixmapSelMargin->Release();
421U467U    pixmapSelPattern->Release();
422U468U    pixmapIndentGuide->Release();
  469A    pixmapIndentGuideHighlight->Release();
423U470U}
424U471U 
425U472Uvoid Editor::InvalidateStyleData() {
416 skipped lines
842U889U    //wMain.InvalidateAll();
843U890U}
844U891U 
845Cvoid Editor::RedrawSelMargin() { 892Cvoid Editor::RedrawSelMargin(int line) {
846U893U    if (!AbandonPaint()) {
847U894U        if (vs.maskInLine) {
848U895U        Redraw();
849U896U        } else {
850U897U        PRectangle rcSelMargin = GetClientRectangle();
851U898U        rcSelMargin.right = vs.fixedColumnWidth;
  899A        if (line != -1) {
  900A        int position = pdoc->LineStart(line);
  901A        PRectangle rcLine = RectangleFromRange(position, position);
  902A        rcSelMargin.top = rcLine.top;
  903A        rcSelMargin.bottom = rcLine.bottom;
  904A        }
852U905U        wMain.InvalidateRectangle(rcSelMargin);
853U906U        }
854U907U    }
44 skipped lines
899U952U    return Platform::Maximum(currentPos, anchor);
900U953U}
901U954U 
  955Avoid Editor::SetRectangularRange() {
  956A    if (selType == selRectangle) {
  957A        xStartSelect = XFromPosition(anchor);
  958A        xEndSelect = XFromPosition(currentPos);
  959A    }
  960A}
  961A 
902U962Uvoid Editor::InvalidateSelection(int currentPos_, int anchor_) {
903U963U    int firstAffected = anchor;
904U964U    if (firstAffected > currentPos)
21 skipped lines
926U986U        currentPos = currentPos_;
927U987U        anchor = anchor_;
928U988U    }
929C    if (selType == selRectangle) {  
930C        xStartSelect = XFromPosition(anchor); 989C    SetRectangularRange();
931C        xEndSelect = XFromPosition(currentPos);  
932C    }  
933U990U    ClaimSelection();
934U991U}
935U992U 
3 skipped lines
939U996U        InvalidateSelection(currentPos_, currentPos_);
940U997U        currentPos = currentPos_;
941U998U    }
942C    if (selType == selRectangle) {  
943C        xStartSelect = XFromPosition(anchor); 999C    SetRectangularRange();
944C        xEndSelect = XFromPosition(currentPos);  
945C    }  
946U1000U    ClaimSelection();
947U1001U}
948U1002U 
116 skipped lines
1065U1119U        SetTopLine(topLineNew);
1066U1120U        ShowCaretAtCurrentPosition();
1067U1121U        // Perform redraw rather than scroll if many lines would be redrawn anyway.
  1122A#ifndef UNDER_CE
1068U1123U        if (abs(linesToMove) <= 10) {
1069U1124U        ScrollText(linesToMove);
1070U1125U        } else {
1071U1126U        Redraw();
1072U1127U        }
  1128A#else
  1129A        Redraw();
  1130A#endif
1073U1131U        if (moveThumb) {
1074U1132U        SetVerticalScrollPos();
1075U1133U        }
796 skipped lines
1872U1930U        posLineEnd = posLineStart + ll->maxLineLength;
1873U1931U    }
1874U1932U    if (ll->validity == LineLayout::llCheckTextAndStyle) {
1875C        int lineLength = 0; 1933C        int lineLength = posLineEnd - posLineStart;
  1934C        if (!vstyle.viewEOL) {
1876C        for (int cid = posLineStart; cid < posLineEnd; cid++) { 1935C        int cid = posLineEnd - 1;
1877C        char chDoc = pdoc->CharAt(cid);  
1878C        if (vstyle.viewEOL || (!IsEOLChar(chDoc))) { 1936C        while ((cid > posLineStart) && IsEOLChar(pdoc->CharAt(cid))) {
  1937C        cid--;
1879C        lineLength++; 1938C        lineLength--;
1880U1939U        }
1881U1940U        }
1882U1941U        if (lineLength == ll->numCharsInLine) {
1883R        int numCharsInLine = 0;  
1884U1942U        // See if chars, styles, indicators, are all the same
1885U1943U        bool allSame = true;
1886U1944U        const int styleMask = pdoc->stylingBitsMask;
1887U1945U        // Check base line layout
  1946C        char styleByte = 0;
  1947C        int numCharsInLine = 0;
  1948C        while (numCharsInLine < lineLength) {
1888C        for (int charInDoc = posLineStart; allSame && (charInDoc < posLineEnd); charInDoc++) { 1949C        int charInDoc = numCharsInLine + posLineStart;
1889U1950U        char chDoc = pdoc->CharAt(charInDoc);
1890C        if (vstyle.viewEOL || (!IsEOLChar(chDoc))) { 1951C        styleByte = pdoc->StyleAt(charInDoc);
  1952C        allSame = allSame &&
  1953C                (ll->styles[numCharsInLine] == static_cast<unsigned char>(styleByte & styleMask));
  1954C        allSame = allSame &&
1891C        char styleByte = pdoc->StyleAt(charInDoc); 1955C                (ll->indicators[numCharsInLine] == static_cast<char>(styleByte & ~styleMask));
  1956C        if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed)
1892U1957U        allSame = allSame &&
1893C                  (ll->styles[numCharsInLine] == static_cast<char>(styleByte & styleMask)); 1958C                (ll->chars[numCharsInLine] == chDoc);
  1959C        else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower)
1894U1960U        allSame = allSame &&
1895C                  (ll->indicators[numCharsInLine] == static_cast<char>(styleByte & ~styleMask));  
1896C        if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseUpper)  
1897C        allSame = allSame &&  
1898C                  (ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc))); 1961C                (ll->chars[numCharsInLine] == static_cast<char>(tolower(chDoc)));
1899C        else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower) 1962C        else// Style::caseUpper
1900C        allSame = allSame && 1963C        allSame = allSame &&
1901C                  (ll->chars[numCharsInLine] == static_cast<char>(tolower(chDoc))); 1964C                (ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc)));
1902C        else  
1903C        allSame = allSame &&  
1904C                  (ll->chars[numCharsInLine] == chDoc);  
1905C        numCharsInLine++; 1965C        numCharsInLine++;
1906C        }  
1907U1966U        }
  1967A        allSame = allSame && (ll->styles[numCharsInLine] == styleByte);   // For eolFilled
1908U1968U        if (allSame) {
1909U1969U        ll->validity = LineLayout::llPositions;
1910U1970U        } else {
18 skipped lines
1929U1989U 
1930U1990U        char styleByte = 0;
1931U1991U        int styleMask = pdoc->stylingBitsMask;
  1992A        ll->styleBitsSet = 0;
1932U1993U        // Fill base line layout
1933U1994U        for (int charInDoc = posLineStart; charInDoc < posLineEnd; charInDoc++) {
1934U1995U        char chDoc = pdoc->CharAt(charInDoc);
1935U1996U        styleByte = pdoc->StyleAt(charInDoc);
  1997A        ll->styleBitsSet |= styleByte;
1936U1998U        if (vstyle.viewEOL || (!IsEOLChar(chDoc))) {
1937U1999U        ll->chars[numCharsInLine] = chDoc;
1938U2000U        ll->styles[numCharsInLine] = static_cast<char>(styleByte & styleMask);
20 skipped lines
1959U2021U        bool lastSegItalics = false;
1960U2022U        Font &ctrlCharsFont = vstyle.styles[STYLE_CONTROLCHAR].font;
1961U2023U 
  2024A        int ctrlCharWidth[32] = {0};
1962U2025U        bool isControlNext = IsControlCharacter(ll->chars[0]);
1963U2026U        for (int charInLine = 0; charInLine < numCharsInLine; charInLine++) {
1964U2027U        bool isControl = isControlNext;
7 skipped lines
1972U2035U        ll->positions[charInLine + 1] = ((((startsegx + 2) /
1973U2036U                                           tabWidth) + 1) * tabWidth) - startsegx;
1974U2037U        } else if (controlCharSymbol < 32) {
  2038C        if (ctrlCharWidth[ll->chars[charInLine]] == 0) {
1975C        const char *ctrlChar = ControlCharacterString(ll->chars[charInLine]); 2039C        const char *ctrlChar = ControlCharacterString(ll->chars[charInLine]);
1976C        // +3 For a blank on front and rounded edge each side: 2040C        // +3 For a blank on front and rounded edge each side:
  2041C        ctrlCharWidth[ll->chars[charInLine]] =
1977C        ll->positions[charInLine + 1] = surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + 3; 2042C        surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + 3;
  2043C        }
  2044C        ll->positions[charInLine + 1] = ctrlCharWidth[ll->chars[charInLine]];
1978U2045U        } else {
1979U2046U        char cc[2] = { static_cast<char>(controlCharSymbol), '\0' };
1980U2047U        surface->MeasureWidths(ctrlCharsFont, cc, 1,
78 skipped lines
2059U2126U        continue;
2060U2127U        }
2061U2128U        if (p > 0) {
  2129C        if (wrapState == eWrapChar){
  2130C        lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1)
  2131C        - posLineStart;
  2132C        p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart;
  2133C        continue;
2062C        if (ll->styles[p] != ll->styles[p - 1]) { 2134C        } else if (ll->styles[p] != ll->styles[p - 1]) {
2063U2135U        lastGoodBreak = p;
2064U2136U        } else if (IsSpaceOrTab(ll->chars[p - 1]) && !IsSpaceOrTab(ll->chars[p])) {
2065U2137U        lastGoodBreak = p;
292 skipped lines
2358U2430U        }
2359U2431U        }
2360U2432U        }
  2433A        } else if (rcSegment.left > rcLine.right) {
  2434A        break;
2361U2435U        }
2362U2436U        startseg = i + 1;
2363U2437U        }
156 skipped lines
2520U2594U        rcUL.bottom = rcUL.top + 1;
2521U2595U        surface->FillRectangle(rcUL, textFore);
2522U2596U        }
  2597A        } else if (rcSegment.left > rcLine.right) {
  2598A        break;
2523U2599U        }
2524U2600U        startseg = i + 1;
2525U2601U        }
2526U2602U    }
2527U2603U 
2528U2604U    // Draw indicators
2529C    int indStart[INDIC_MAX + 1] = {0}; 2605C    // foreach indicator...
2530C    for (int indica = 0; indica <= INDIC_MAX; indica++)  
2531C        indStart[indica] = 0;  
2532C   
2533C    for (int indicPos = lineStart; indicPos <= lineEnd; indicPos++) { 2606C    for (int indicnum = 0, mask = 1 << pdoc->stylingBits; mask < 0x100; indicnum++) {
2534C        if ((indicPos == lineStart) || (indicPos == lineEnd) || 2607C        if (!(mask & ll->styleBitsSet)) {
2535C        (ll->indicators[indicPos] != ll->indicators[indicPos + 1])) { 2608C        mask <<= 1;
  2609C        continue;
  2610C        }
2536C        int mask = 1 << pdoc->stylingBits; 2611C        int startPos = -1;
  2612C        // foreach style pos in line...
2537C        for (int indicnum = 0; mask < 0x100; indicnum++) { 2613C        for (int indicPos = lineStart; indicPos <= lineEnd; indicPos++) {
  2614C        // look for starts...
2538C        if ((indicPos == lineStart) || (indicPos == lineEnd)) { 2615C        if (startPos < 0) {
2539C        indStart[indicnum] = ll->positions[indicPos]; 2616C        // NOT in indicator run, looking for START
2540C        } else if ((ll->indicators[indicPos + 1] & mask) && !(ll->indicators[indicPos] & mask)) { 2617C        if (indicPos < lineEnd && (ll->indicators[indicPos] & mask))
2541C        indStart[indicnum] = ll->positions[indicPos + 1]; 2618C        startPos = indicPos;
2542C        } 2619C        }
  2620C        // ... or ends
2543C        if ((ll->indicators[indicPos] & mask) && 2621C        if (startPos >= 0) {
  2622C        // IN indicator run, looking for END
2544C        ((indicPos == lineEnd) || !(ll->indicators[indicPos + 1] & mask))) { 2623C        if (indicPos >lineEnd || !(ll->indicators[indicPos] & mask)) {
2545C        int endIndicator = indicPos; 2624C        // AT end of indicator run, DRAW it!
2546C        if (endIndicator >= lineEnd)  
2547C        endIndicator = lineEnd-1;  
2548U2625U        PRectangle rcIndic(
2549C        indStart[indicnum] + xStart - subLineStart, 2626C        ll->positions[startPos] + xStart - subLineStart,
2550U2627U        rcLine.top + vsDraw.maxAscent,
2551C        ll->positions[endIndicator + 1] + xStart - subLineStart, 2628C        ll->positions[indicPos] + xStart - subLineStart,
2552U2629U        rcLine.top + vsDraw.maxAscent + 3);
2553U2630U        vsDraw.indicators[indicnum].Draw(surface, rcIndic, rcLine);
  2631A        // RESET control var
  2632A        startPos = -1;
2554U2633U        }
2555R        mask = mask << 1;  
2556U2634U        }
2557U2635U        }
  2636A        mask <<= 1;
2558U2637U    }
2559U2638U    // End of the drawing of the current line
2560U2639U    if (!twoPhaseDraw) {
68 skipped lines
2629U2708U    if (bufferedDraw) {
2630U2709U        if (!pixmapLine->Initialised()) {
2631U2710U        PRectangle rcClient = GetClientRectangle();
2632C        pixmapLine->InitPixMap(rcClient.Width(), rcClient.Height(), 2711C        pixmapLine->InitPixMap(rcClient.Width(), vs.lineHeight,
2633U2712U                               surfaceWindow, wMain.GetID());
2634U2713U        pixmapSelMargin->InitPixMap(vs.fixedColumnWidth,
2635U2714U                                    rcClient.Height(), surfaceWindow, wMain.GetID());
124 skipped lines
2760U2839U        //ElapsedTime et;
2761U2840U        if (lineDoc != lineDocPrevious) {
2762U2841U        ll.Set(0);
  2842A        // For rectangular selection this accesses the layout cache so should be after layout returned.
  2843A        lineIterator.SetAt(lineDoc);
2763U2844U        ll.Set(RetrieveLineLayout(lineDoc));
2764U2845U        LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
2765U2846U        lineDocPrevious = lineDoc;
5 skipped lines
2771U2852U        ll->selStart = SelectionStart();
2772U2853U        ll->selEnd = SelectionEnd();
2773U2854U        } else {
2774R        lineIterator.SetAt(lineDoc);  
2775U2855U        ll->selStart = lineIterator.startPos;
2776U2856U        ll->selEnd = lineIterator.endPos;
2777U2857U        }
142 skipped lines
2920U3000U        visibleLine++;
2921U3001U        //gdk_flush();
2922U3002U        }
  3003A        ll.Set(0);
2923U3004U        //if (durPaint < 0.00000001)
2924U3005U        //  durPaint = 0.00000001;
2925U3006U 
234 skipped lines
3160U3241U    int nMax = MaxScrollPos();
3161U3242U    int nPage = LinesOnScreen();
3162U3243U    bool modified = ModifyScrollBars(nMax + nPage - 1, nPage);
  3244A    if (modified) {
  3245A        DwellEnd(true);
  3246A    }
3163U3247U 
3164U3248U    // TODO: ensure always showing as many lines as possible
3165U3249U    // May not be, if, for example, window made larger
33 skipped lines
3199U3283Uvoid Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
3200U3284U    bool wasSelection = currentPos != anchor;
3201U3285U    ClearSelection();
  3286A    bool charReplaceAction = false;
3202U3287U    if (inOverstrike && !wasSelection && !RangeContainsProtected(currentPos, currentPos + 1)) {
3203U3288U        if (currentPos < (pdoc->Length())) {
3204U3289U        if (!IsEOLChar(pdoc->CharAt(currentPos))) {
  3290A        charReplaceAction = true;
  3291A        pdoc->BeginUndoAction();
3205U3292U        pdoc->DelChar(currentPos);
3206U3293U        }
3207U3294U        }
1 skipped line
3209U3296U    if (pdoc->InsertString(currentPos, s, len)) {
3210U3297U        SetEmptySelection(currentPos + len);
3211U3298U    }
  3299A    if (charReplaceAction) {
  3300A        pdoc->EndUndoAction();
  3301A    }
3212U3302U    EnsureCaretVisible();
3213U3303U    // Avoid blinking during rapid typing:
3214U3304U    ShowCaretAtCurrentPosition();
  3305C    if (!caretSticky) {
3215C    SetLastXChosen(); 3306C        SetLastXChosen();
  3307C    }
3216U3308U 
3217U3309U    if (treatAsDBCS) {
3218U3310U        NotifyChar((static_cast<unsigned char>(s[0]) << 8) |
73 skipped lines
3292U3384U    currentPos = 0;
3293U3385U    SetTopLine(0);
3294U3386U    SetVerticalScrollPos();
3295C        InvalidateStyleRedraw();        // RPD: patch #1106564 3387C    InvalidateStyleRedraw();
3296U3388U}
3297U3389U 
3298U3390Uvoid Editor::ClearDocumentStyle() {
72 skipped lines
3371U3463U    if (pdoc->CanUndo()) {
3372U3464U        InvalidateCaret();
3373U3465U        int newPos = pdoc->Undo();
  3466C        if (newPos >= 0)
3374C        SetEmptySelection(newPos); 3467C        SetEmptySelection(newPos);
3375U3468U        EnsureCaretVisible();
3376U3469U    }
3377U3470U}
1 skipped line
3379U3472Uvoid Editor::Redo() {
3380U3473U    if (pdoc->CanRedo()) {
3381U3474U        int newPos = pdoc->Redo();
  3475C        if (newPos >= 0)
3382C        SetEmptySelection(newPos); 3476C        SetEmptySelection(newPos);
3383U3477U        EnsureCaretVisible();
3384U3478U    }
3385U3479U}
39 skipped lines
3425U3519Uvoid Editor::NotifyFocus(bool) {}
3426U3520U 
3427U3521Uvoid Editor::NotifyStyleToNeeded(int endStyleNeeded) {
3428C    SCNotification scn; 3522C    SCNotification scn = {0};
3429U3523U    scn.nmhdr.code = SCN_STYLENEEDED;
3430U3524U    scn.position = endStyleNeeded;
3431U3525U    NotifyParent(scn);
4 skipped lines
3436U3530U}
3437U3531U 
3438U3532Uvoid Editor::NotifyChar(int ch) {
3439C    SCNotification scn; 3533C    SCNotification scn = {0};
3440U3534U    scn.nmhdr.code = SCN_CHARADDED;
3441U3535U    scn.ch = ch;
3442U3536U    NotifyParent(scn);
6 skipped lines
3449U3543U}
3450U3544U 
3451U3545Uvoid Editor::NotifySavePoint(bool isSavePoint) {
3452C    SCNotification scn; 3546C    SCNotification scn = {0};
3453U3547U    if (isSavePoint) {
3454U3548U        scn.nmhdr.code = SCN_SAVEPOINTREACHED;
3455U3549U    } else {
3 skipped lines
3459U3553U}
3460U3554U 
3461U3555Uvoid Editor::NotifyModifyAttempt() {
3462C    SCNotification scn; 3556C    SCNotification scn = {0};
3463U3557U    scn.nmhdr.code = SCN_MODIFYATTEMPTRO;
3464U3558U    NotifyParent(scn);
3465U3559U}
3466U3560U 
3467U3561Uvoid Editor::NotifyDoubleClick(Point, bool) {
3468C    SCNotification scn; 3562C    SCNotification scn = {0};
3469U3563U    scn.nmhdr.code = SCN_DOUBLECLICK;
3470U3564U    NotifyParent(scn);
3471U3565U}
3472U3566U 
3473U3567Uvoid Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) {
3474C    SCNotification scn; 3568C    SCNotification scn = {0};
3475U3569U    scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK;
3476U3570U    scn.position = position;
3477U3571U    scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
2 skipped lines
3480U3574U}
3481U3575U 
3482U3576Uvoid Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) {
3483C    SCNotification scn; 3577C    SCNotification scn = {0};
3484U3578U    scn.nmhdr.code = SCN_HOTSPOTCLICK;
3485U3579U    scn.position = position;
3486U3580U    scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
2 skipped lines
3489U3583U}
3490U3584U 
3491U3585Uvoid Editor::NotifyUpdateUI() {
3492C    SCNotification scn; 3586C    SCNotification scn = {0};
3493U3587U    scn.nmhdr.code = SCN_UPDATEUI;
3494U3588U    NotifyParent(scn);
3495U3589U}
3496U3590U 
3497U3591Uvoid Editor::NotifyPainted() {
3498C    SCNotification scn; 3592C    SCNotification scn = {0};
3499U3593U    scn.nmhdr.code = SCN_PAINTED;
3500U3594U    NotifyParent(scn);
3501U3595U}
7 skipped lines
3509U3603U        x += vs.ms[margin].width;
3510U3604U    }
3511U3605U    if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) {
3512C        SCNotification scn; 3606C        SCNotification scn = {0};
3513U3607U        scn.nmhdr.code = SCN_MARGINCLICK;
3514U3608U        scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
3515U3609U                        (alt ? SCI_ALT : 0);
7 skipped lines
3523U3617U}
3524U3618U 
3525U3619Uvoid Editor::NotifyNeedShown(int pos, int len) {
3526C    SCNotification scn; 3620C    SCNotification scn = {0};
3527U3621U    scn.nmhdr.code = SCN_NEEDSHOWN;
3528U3622U    scn.position = pos;
3529U3623U    scn.length = len;
1 skipped line
3531U3625U}
3532U3626U 
3533U3627Uvoid Editor::NotifyDwelling(Point pt, bool state) {
3534C    SCNotification scn; 3628C    SCNotification scn = {0};
3535U3629U    scn.nmhdr.code = state ? SCN_DWELLSTART : SCN_DWELLEND;
3536U3630U    scn.position = PositionFromLocationClose(pt);
3537U3631U    scn.x = pt.x;
2 skipped lines
3540U3634U}
3541U3635U 
3542U3636Uvoid Editor::NotifyZoom() {
3543C    SCNotification scn; 3637C    SCNotification scn = {0};
3544U3638U    scn.nmhdr.code = SCN_ZOOM;
3545U3639U    NotifyParent(scn);
3546U3640U}
5 skipped lines
3552U3646U}
3553U3647U 
3554U3648Uvoid Editor::NotifyMove(int position) {
3555C    SCNotification scn; 3649C    SCNotification scn = {0};
3556U3650U    scn.nmhdr.code = SCN_POSCHANGED;
3557U3651U    scn.position = position;
3558U3652U    NotifyParent(scn);
5 skipped lines
3564U3658U}
3565U3659U 
3566U3660Uvoid Editor::CheckModificationForWrap(DocModification mh) {
3567C    if ((mh.modificationType & SC_MOD_INSERTTEXT) || 3661C    if (mh.modificationType & (SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT)) {
3568C            (mh.modificationType & SC_MOD_DELETETEXT)) {  
3569U3662U        llc.Invalidate(LineLayout::llCheckTextAndStyle);
3570U3663U        if (wrapState != eWrapNone) {
3571U3664U        int lineDoc = pdoc->LineFromPosition(mh.position);
69 skipped lines
3641U3734U        // Some lines are hidden so may need shown.
3642U3735U        // TODO: check if the modified area is hidden.
3643U3736U        if (mh.modificationType & SC_MOD_BEFOREINSERT) {
3644C        NotifyNeedShown(mh.position, mh.length); 3737C        NotifyNeedShown(mh.position, 0);
3645U3738U        } else if (mh.modificationType & SC_MOD_BEFOREDELETE) {
3646U3739U        NotifyNeedShown(mh.position, mh.length);
3647U3740U        }
11 skipped lines
3659U3752U        CheckModificationForWrap(mh);
3660U3753U        if (mh.linesAdded != 0) {
3661U3754U        // Avoid scrolling of display if change before current display
3662C        if (mh.position < posTopLine) { 3755C        if (mh.position < posTopLine && !CanDeferToLastStep(mh)) {
3663U3756U        int newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos());
3664U3757U        if (newTop != topLine) {
3665U3758U        SetTopLine(newTop);
4 skipped lines
3670U3763U        //Platform::DebugPrintf("** %x Doc Changed\n", this);
3671U3764U        // TODO: could invalidate from mh.startModification to end of screen
3672U3765U        //InvalidateRange(mh.position, mh.position + mh.length);
3673C        if (paintState == notPainting) { 3766C        if (paintState == notPainting && !CanDeferToLastStep(mh)) {
3674U3767U        Redraw();
3675U3768U        }
3676U3769U        } else {
3677U3770U        //Platform::DebugPrintf("** %x Line Changed %d .. %d\n", this,
3678U3771U        //  mh.position, mh.position + mh.length);
3679C        if (paintState == notPainting) { 3772C        if (paintState == notPainting && mh.length && !CanEliminate(mh)) {
3680U3773U        InvalidateRange(mh.position, mh.position + mh.length);
3681U3774U        }
3682U3775U        }
3683U3776U    }
3684U3777U 
3685C    if (mh.linesAdded != 0) { 3778C    if (mh.linesAdded != 0 && !CanDeferToLastStep(mh)) {
3686U3779U        SetScrollBars();
3687U3780U    }
3688U3781U 
3689U3782U    if (mh.modificationType & SC_MOD_CHANGEMARKER) {
3690C        if (paintState == notPainting) { 3783C        if ((paintState == notPainting) || !PaintContainsMargin()) {
  3784C        if (mh.modificationType & SC_MOD_CHANGEFOLD) {
  3785C        // Fold changes can affect the drawing of following lines so redraw whole margin
3691C        RedrawSelMargin(); 3786C        RedrawSelMargin();
  3787C        } else {
  3788C        RedrawSelMargin(mh.line);
  3789C        }
3692U3790U        }
3693U3791U    }
3694U3792U 
  3793A    // NOW pay the piper WRT "deferred" visual updates
  3794A    if (IsLastStep(mh)) {
  3795A        SetScrollBars();
  3796A        Redraw();
  3797A    }
  3798A 
3695U3799U    // If client wants to see this modification
3696U3800U    if (mh.modificationType & modEventMask) {
3697U3801U        if ((mh.modificationType & SC_MOD_CHANGESTYLE) == 0) {
1 skipped line
3699U3803U        NotifyChange();   // Send EN_CHANGE
3700U3804U        }
3701U3805U 
3702C        SCNotification scn; 3806C        SCNotification scn = {0};
3703U3807U        scn.nmhdr.code = SCN_MODIFIED;
3704U3808U        scn.position = mh.position;
3705U3809U        scn.modificationType = mh.modificationType;
11 skipped lines
3717U3821U    /* Do nothing */
3718U3822U}
3719U3823U 
3720Cvoid Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long lParam) { 3824Cvoid Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
3721U3825U 
3722U3826U    // Enumerates all macroable messages
3723U3827U    switch (iMessage) {
94 skipped lines
3818U3922U    case SCI_LINEENDRECTEXTEND:
3819U3923U    case SCI_PAGEUPRECTEXTEND:
3820U3924U    case SCI_PAGEDOWNRECTEXTEND:
  3925A    case SCI_SELECTIONDUPLICATE:
3821U3926U        break;
3822U3927U 
3823U3928U    // Filter out all others like display changes. Also, newlines are redundant
5 skipped lines
3829U3934U    }
3830U3935U 
3831U3936U    // Send notification
3832C    SCNotification scn; 3937C    SCNotification scn = {0};
3833U3938U    scn.nmhdr.code = SCN_MACRORECORD;
3834U3939U    scn.message = iMessage;
3835U3940U    scn.wParam = wParam;
95 skipped lines
3931U4036U    }
3932U4037U}
3933U4038U 
3934Cvoid Editor::LineDuplicate() { 4039Cvoid Editor::Duplicate(bool forLine) {
  4040C    int start = SelectionStart();
  4041C    int end = SelectionEnd();
  4042C    if (start == end) {
  4043C        forLine = true;
  4044C    }
  4045C    if (forLine) {
3935C    int line = pdoc->LineFromPosition(currentPos); 4046C        int line = pdoc->LineFromPosition(currentPos);
3936C    int start = pdoc->LineStart(line); 4047C        start = pdoc->LineStart(line);
3937C    int end = pdoc->LineEnd(line); 4048C        end = pdoc->LineEnd(line);
  4049C    }
3938C    char *thisLine = CopyRange(start, end); 4050C    char *text = CopyRange(start, end);
  4051C    if (forLine) {
3939C    const char *eol = StringFromEOLMode(pdoc->eolMode); 4052C        const char *eol = StringFromEOLMode(pdoc->eolMode);
3940C    pdoc->InsertString(end, eol); 4053C        pdoc->InsertString(end, eol);
3941C    pdoc->InsertString(end + istrlen(eol), thisLine, end - start); 4054C        pdoc->InsertString(end + istrlen(eol), text, end - start);
  4055C    } else {
  4056C        pdoc->InsertString(end, text, end - start);
  4057C    }
3942C    delete []thisLine; 4058C    delete []text;
3943U4059U}
3944U4060U 
3945U4061Uvoid Editor::CancelModes() {
17 skipped lines
3963U4079U    }
3964U4080U    SetLastXChosen();
3965U4081U    EnsureCaretVisible();
  4082A    // Avoid blinking during rapid typing:
  4083A    ShowCaretAtCurrentPosition();
3966U4084U}
3967U4085U 
3968U4086Uvoid Editor::CursorUpOrDown(int direction, selTypes sel) {
14 skipped lines
3983U4101U    MovePositionTo(posNew, sel);
3984U4102U}
3985U4103U 
  4104Avoid Editor::ParaUpOrDown(int direction, selTypes sel) {
  4105A    int lineDoc, savedPos = currentPos;
  4106A    do {
  4107A        MovePositionTo(direction > 0 ? pdoc->ParaDown(currentPos) : pdoc->ParaUp(currentPos), sel);
  4108A        lineDoc = pdoc->LineFromPosition(currentPos);
6 skipped lines
  4115A        }
  4116A        }
  4117A    } while (!cs.GetVisible(lineDoc));
  4118A}
  4119A 
3986U4120Uint Editor::StartEndDisplayLine(int pos, bool start) {
3987U4121U    RefreshStyleData();
3988U4122U    int line = pdoc->LineFromPosition(pos);
38 skipped lines
4027U4161U        CursorUpOrDown(1, selRectangle);
4028U4162U        break;
4029U4163U    case SCI_PARADOWN:
4030C        MovePositionTo(pdoc->ParaDown(currentPos)); 4164C        ParaUpOrDown(1);
4031U4165U        break;
4032U4166U    case SCI_PARADOWNEXTEND:
4033C        MovePositionTo(pdoc->ParaDown(currentPos), selStream); 4167C        ParaUpOrDown(1selStream);
4034U4168U        break;
4035U4169U    case SCI_LINESCROLLDOWN:
4036U4170U        ScrollTo(topLine + 1);
9 skipped lines
4046U4180U        CursorUpOrDown(-1, selRectangle);
4047U4181U        break;
4048U4182U    case SCI_PARAUP:
4049C        MovePositionTo(pdoc->ParaUp(currentPos)); 4183C        ParaUpOrDown(-1);
4050U4184U        break;
4051U4185U    case SCI_PARAUPEXTEND:
4052C        MovePositionTo(pdoc->ParaUp(currentPos), selStream); 4186C        ParaUpOrDown(-1, selStream);
4053U4187U        break;
4054U4188U    case SCI_LINESCROLLUP:
4055U4189U        ScrollTo(topLine - 1);
183 skipped lines
4239U4373U        break;
4240U4374U    case SCI_DELETEBACK:
4241U4375U        DelCharBack(true);
  4376C        if (!caretSticky) {
4242C        SetLastXChosen(); 4377C        SetLastXChosen();
  4378C        }
4243U4379U        EnsureCaretVisible();
4244U4380U        break;
4245U4381U    case SCI_DELETEBACKNOTLINE:
4246U4382U        DelCharBack(false);
  4383C        if (!caretSticky) {
4247C        SetLastXChosen(); 4384C        SetLastXChosen();
  4385C        }
4248U4386U        EnsureCaretVisible();
4249U4387U        break;
4250U4388U    case SCI_TAB:
4251U4389U        Indent(true);
  4390C        if (!caretSticky) {
4252C        SetLastXChosen(); 4391C        SetLastXChosen();
  4392C        }
4253U4393U        EnsureCaretVisible();
4254U4394U        break;
4255U4395U    case SCI_BACKTAB:
4256U4396U        Indent(false);
  4397C        if (!caretSticky) {
4257C        SetLastXChosen(); 4398C        SetLastXChosen();
  4399C        }
4258U4400U        EnsureCaretVisible();
4259U4401U        break;
4260U4402U    case SCI_NEWLINE:
100 skipped lines
4361U4503U        LineTranspose();
4362U4504U        break;
4363U4505U    case SCI_LINEDUPLICATE:
  4506C        Duplicate(true);
  4507C        break;
  4508C    case SCI_SELECTIONDUPLICATE:
4364C        LineDuplicate(); 4509C        Duplicate(false);
4365U4510U        break;
4366U4511U    case SCI_LOWERCASE:
4367U4512U        ChangeCaseOfSelection(false);
610 skipped lines
4978U5123U        NotifyHotSpotClicked(newPos, shift, ctrl, alt);
4979U5124U        }
4980U5125U        if (!shift) {
4981C        inDragDrop = PointInSelection(pt); 5126C        inDragDrop = PointInSelection(pt) && !SelectionEmpty();
4982U5127U        }
4983U5128U        if (inDragDrop) {
4984U5129U        SetMouseCapture(false);
7 skipped lines
4992U5137U        SetEmptySelection(newPos);
4993U5138U        }
4994U5139U        selType = alt ? selRectangle : selStream;
4995R        xStartSelect = xEndSelect = pt.x - vs.fixedColumnWidth + xOffset;  
4996U5140U        selectionType = selChar;
4997U5141U        originalAnchorPos = currentPos;
  5142A        SetRectangularRange();
4998U5143U        }
4999U5144U        }
5000U5145U    }
130 skipped lines
5131U5276U        }
5132U5277U        }
5133U5278U        // Display regular (drag) cursor over selection
5134C        if (PointInSelection(pt)) { 5279C        if (PointInSelection(pt) && !SelectionEmpty()) {
5135U5280U        DisplayCursor(Window::cursorArrow);
5136U5281U        } else if (PointIsHotspot(pt)) {
5137U5282U        DisplayCursor(Window::cursorHand);
6 skipped lines
5144U5289U}
5145U5290U 
5146U5291Uvoid Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
5147C    //Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture()); 5292C        //Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture());
5148U5293U    if (HaveMouseCapture()) {
5149U5294U        if (PointInSelMargin(pt)) {
5150U5295U        DisplayCursor(Window::cursorReverseArrow);
37 skipped lines
5188U5333U        SetSelection(newPos);
5189U5334U        }
5190U5335U        }
5191C        // Now we rely on the current pos to compute rectangular selection  
5192C        xStartSelect = XFromPosition(anchor);  
5193C        xEndSelect = XFromPosition(currentPos); 5336C        SetRectangularRange();
5194U5337U        lastClickTime = curTime;
5195U5338U        lastClick = pt;
5196U5339U        lastXChosen = pt.x;
17 skipped lines
5214U5357U        if (timer.ticksToWait <= 0) {
5215U5358U        caret.on = !caret.on;
5216U5359U        timer.ticksToWait = caret.period;
  5360C        if (caret.active) {
5217C        InvalidateCaret(); 5361C        InvalidateCaret();
  5362C        }
5218U5363U        }
5219U5364U    }
5220U5365U    if ((dwellDelay < SC_TIME_FOREVER) &&
42 skipped lines
5263U5408U    }
5264U5409U}
5265U5410U 
5266Cstatic bool IsIn(int a, int minimum, int maximum) { 5411Cbool Editor::PaintContains(PRectangle rc) {
5267C    return (a >= minimum) && (a <= maximum); 5412C    return rcPaint.Contains(rc);
5268U5413U}
5269U5414U 
5270Cstatic bool IsOverlap(int mina, int maxa, int minb, int maxb) { 5415Cbool Editor::PaintContainsMargin() {
5271C    return 5416C    PRectangle rcSelMargin = GetClientRectangle();
5272C        IsIn(mina, minb, maxb) || 5417C    rcSelMargin.right = vs.fixedColumnWidth;
5273C        IsIn(maxa, minb, maxb) ||  
5274C        IsIn(minb, mina, maxa) ||  
5275C        IsIn(maxb, mina, maxa); 5418C    return PaintContains(rcSelMargin);
5276U5419U}
5277U5420U 
5278U5421Uvoid Editor::CheckForChangeOutsidePaint(Range r) {
2 skipped lines
5281U5424U        if (!r.Valid())
5282U5425U        return;
5283U5426U 
  5427A        PRectangle rcRange = RectangleFromRange(r.start, r.end);
5284U5428U        PRectangle rcText = GetTextRectangle();
5285C        // Determine number of lines displayed including a possible partially displayed last line  
5286C        int linesDisplayed = (rcText.bottom - rcText.top - 1) / vs.lineHeight + 1; 5429C        if (rcRange.top < rcText.top) {
5287C        int bottomLine = topLine + linesDisplayed - 1;  
5288C   
5289C        int lineRangeStart = cs.DisplayFromDoc(pdoc->LineFromPosition(r.start));  
5290C        int lineRangeEnd = cs.DisplayFromDoc(pdoc->LineFromPosition(r.end));  
5291C        if (!IsOverlap(topLine, bottomLine, lineRangeStart, lineRangeEnd)) {  
5292C        //Platform::DebugPrintf("No overlap (%d-%d) with window(%d-%d)\n",  
5293C        //  lineRangeStart, lineRangeEnd, topLine, bottomLine);  
5294C        return; 5430C        rcRange.top = rcText.top;
5295U5431U        }
5296C   
5297C        // Assert rcPaint contained within or equal to rcText  
5298C        if (rcPaint.top > rcText.top) { 5432C        if (rcRange.bottom > rcText.bottom) {
5299C        // does range intersect rcText.top .. rcPaint.top  
5300C        int paintTopLine = ((rcPaint.top - rcText.top - 1) / vs.lineHeight) + topLine; 5433C        rcRange.bottom = rcText.bottom;
5301C        // paintTopLine is the top line of the paint rectangle or the line just above if that line is completely inside the paint rectangle  
5302C        if (IsOverlap(topLine, paintTopLine, lineRangeStart, lineRangeEnd)) {  
5303C        //Platform::DebugPrintf("Change (%d-%d) in top npv(%d-%d)\n",  
5304C        //  lineRangeStart, lineRangeEnd, topLine, paintTopLine);  
5305C        AbandonPaint();  
5306C        return;  
5307C        }  
5308U5434U        }
5309R        if (rcPaint.bottom < rcText.bottom) {  
5310R        // does range intersect rcPaint.bottom .. rcText.bottom  
5311R        int paintBottomLine = ((rcPaint.bottom - rcText.top - 1) / vs.lineHeight + 1) + topLine;  
5312R        // paintTopLine is the bottom line of the paint rectangle or the line just below if that line is completely inside the paint rectangle  
5313R        if (IsOverlap(paintBottomLine, bottomLine, lineRangeStart, lineRangeEnd)) {  
26 skipped lines
5340R        return '<';  
5341R    default:  
5342R        return '\0';  
5343R    }  
5344R}  
5345U5435U 
5346C// TODO: should be able to extend styled region to find matching brace  
5347C// TODO: may need to make DBCS safe  
5348C// so should be moved into Document  
5349Cint Editor::BraceMatch(int position, int /*maxReStyle*/) {  
5350C    char chBrace = pdoc->CharAt(position);  
5351C    char chSeek = BraceOpposite(chBrace);  
5352C    if (chSeek == '\0')  
5353C        return - 1;  
5354C    char styBrace = static_cast<char>(  
5355C                        pdoc->StyleAt(position) & pdoc->stylingBitsMask);  
5356C    int direction = -1;  
5357C    if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<')  
5358C        direction = 1;  
5359C    int depth = 1;  
5360C    position = position + direction;  
5361C    while ((position >= 0) && (position < pdoc->Length())) {  
5362C        char chAtPos = pdoc->CharAt(position);  
5363C        char styAtPos = static_cast<char>(pdoc->StyleAt(position) & pdoc->stylingBitsMask);  
5364C        if ((position > pdoc->GetEndStyled()) || (styAtPos == styBrace)) { 5436C        if (!PaintContains(rcRange)) {
5365C        if (chAtPos == chBrace)  
5366C        depth++;  
5367C        if (chAtPos == chSeek)  
5368C        depth--;  
5369C        if (depth == 0)  
5370C        return position; 5437C        AbandonPaint();
5371U5438U        }
5372R        position = position + direction;  
5373U5439U    }
5374R    return - 1;  
5375U5440U}
5376U5441U 
5377U5442Uvoid Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) {
43 skipped lines
5421U5486U    NeedWrapping();
5422U5487U 
5423U5488U    pdoc->AddWatcher(this, 0);
5424R    Redraw();  
5425U5489U    SetScrollBars();
  5490A    Redraw();
5426U5491U}
5427U5492U 
5428U5493U/**
129 skipped lines
5558U5623U        return 0;
5559U5624U}
5560U5625U 
  5626Aint Editor::WrapCount(int line) {
  5627A    AutoSurface surface(this);
  5628A    AutoLineLayout ll(llc, RetrieveLineLayout(line));
  5629A 
  5630A    if (surface && ll) {
2 skipped lines
  5633A    } else {
  5634A        return 1;
  5635A    }
  5636A}
  5637A 
5561U5638Ustatic bool ValidMargin(unsigned long wParam) {
5562U5639U    return wParam < ViewStyle::margins;
5563U5640U}
57 skipped lines
5621U5698U 
5622U5699U    case SCI_PASTE:
5623U5700U        Paste();
  5701C        if (!caretSticky) {
5624C        SetLastXChosen(); 5702C        SetLastXChosen();
  5703C        }
5625U5704U        EnsureCaretVisible();
5626U5705U        break;
5627U5706U 
9 skipped lines
5637U5716U        break;
5638U5717U 
5639U5718U    case SCI_CANUNDO:
5640C        return pdoc->CanUndo() ? 1 : 0; 5719C        return (pdoc->CanUndo() && !pdoc->IsReadOnly()) ? 1 : 0;
5641U5720U 
5642U5721U    case SCI_EMPTYUNDOBUFFER:
5643U5722U        pdoc->DeleteUndoHistory();
422 skipped lines
6066U6145U        }
6067U6146U 
6068U6147U    case SCI_CANREDO:
6069C        return pdoc->CanRedo() ? 1 : 0; 6148C        return (pdoc->CanRedo() && !pdoc->IsReadOnly()) ? 1 : 0;
6070U6149U 
6071U6150U    case SCI_MARKERLINEFROMHANDLE:
6072U6151U        return pdoc->LineFromHandle(wParam);
33 skipped lines
6106U6185U        if (lParam == 0) {
6107U6186U        return 1 + lineEnd - lineStart;
6108U6187U        }
  6188A        PLATFORM_ASSERT(wParam > 0);
6109U6189U        char *ptr = CharPtrFromSPtr(lParam);
6110U6190U        unsigned int iPlace = 0;
6111U6191U        for (unsigned int iChar = lineStart; iChar < lineEnd && iPlace < wParam - 1; iChar++) {
113 skipped lines
6225U6305U        return pdoc->ExtendWordSelect(wParam, 1, lParam != 0);
6226U6306U 
6227U6307U    case SCI_SETWRAPMODE:
  6308C        switch(wParam){
  6309C        case SC_WRAP_WORD:
  6310C        wrapState = eWrapWord;
  6311C        break;
  6312C        case SC_WRAP_CHAR:
  6313C        wrapState = eWrapChar;
  6314C        break;
  6315C        default:
6228C        wrapState = (wParam == SC_WRAP_WORD) ? eWrapWord : eWrapNone; 6316C        wrapState = eWrapNone;
  6317C        break;
  6318C        }
6229U6319U        xOffset = 0;
6230U6320U        InvalidateStyleRedraw();
6231U6321U        ReconfigureScrollBars();
79 skipped lines
6311U6401U    case SCI_GETENDATLASTLINE:
6312U6402U        return endAtLastLine;
6313U6403U 
  6404A    case SCI_SETCARETSTICKY:
  6405A        PLATFORM_ASSERT((wParam == 0) || (wParam == 1));
  6406A        if (caretSticky != (wParam != 0)) {
  6407A        caretSticky = wParam != 0;
  6408A        }
4 skipped lines
  6413A 
  6414A    case SCI_TOGGLECARETSTICKY:
  6415A        caretSticky = !caretSticky;
  6416A        break;
  6417A 
6314U6418U    case SCI_GETCOLUMN:
6315U6419U        return pdoc->GetColumn(wParam);
6316U6420U 
82 skipped lines
6399U6503U        int markerID = pdoc->AddMark(wParam, lParam);
6400U6504U        return markerID;
6401U6505U        }
  6506A    case SCI_MARKERADDSET:
  6507A        if (lParam != 0)
  6508A        pdoc->AddMarkSet(wParam, lParam);
  6509A        break;
6402U6510U 
6403U6511U    case SCI_MARKERDELETE:
6404U6512U        pdoc->DeleteMark(wParam, lParam);
213 skipped lines
6618U6726U    case SCI_DOCLINEFROMVISIBLE:
6619U6727U        return cs.DocFromDisplay(wParam);
6620U6728U 
  6729A    case SCI_WRAPCOUNT:
  6730A        return WrapCount(wParam);
  6731A 
6621U6732U    case SCI_SETFOLDLEVEL: {
6622U6733U        int prev = pdoc->SetLevel(wParam, lParam);
6623U6734U        if (prev != lParam)
249 skipped lines
6873U6984U    case SCI_LINEENDRECTEXTEND:
6874U6985U    case SCI_PAGEUPRECTEXTEND:
6875U6986U    case SCI_PAGEDOWNRECTEXTEND:
  6987A    case SCI_SELECTIONDUPLICATE:
6876U6988U        return KeyCommand(iMessage);
6877U6989U 
6878U6990U    case SCI_BRACEHIGHLIGHT:
7 skipped lines
6886U6998U    case SCI_BRACEMATCH:
6887U6999U        // wParam is position of char to find brace for,
6888U7000U        // lParam is maximum amount of text to restyle to find it
6889C        return BraceMatch(wParam, lParam); 7001C        return pdoc->BraceMatch(wParam, lParam);
6890U7002U 
6891U7003U    case SCI_GETVIEWEOL:
6892U7004U        return vs.viewEOL;
210 skipped lines
7103U7215U        InvalidateStyleRedraw();
7104U7216U        break;
7105U7217U 
  7218A    case SCI_SETPASTECONVERTENDINGS:
  7219A        convertPastes = wParam != 0;
  7220A        break;
  7221A 
  7222A    case SCI_GETPASTECONVERTENDINGS:
  7223A        return convertPastes ? 1 : 0;
  7224A 
7106U7225U    default:
7107U7226U        return DefWndProc(iMessage, wParam, lParam);
7108U7227U    }
4 skipped lines

   Text comparison Options  

Match character case: yes.
Match line endings: no.
Match spaces

At start of lines: yes,
In middle of lines: yes,
At end of lines: yes.
Blank lines as empty lines: no.
Activate comparison algorithm
At word level: yes,
At character level: no.


   Legend  

UExample of unchanged line
CExample of modified line
AExample of added line
RExample of removed line
IExample of ignored line
Modified text
Added text
Removed text

This report has been generated by Ellié Computing Merge on 2006-09-07 16:23:32.001 +0200.
© 2005-2006 Ellié Computing http://www.elliecomputing.com. All rights reserved.