From: boca4711 <boc...@us...> - 2004-10-18 17:00:26
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2716 Modified Files: ScintillaEx.cpp Log Message: SaveFile remembers line and col of last selection because remove trailing spaces can move selection Index: ScintillaEx.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaEx.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ScintillaEx.cpp 28 Sep 2004 20:07:02 -0000 1.16 --- ScintillaEx.cpp 18 Oct 2004 17:00:18 -0000 1.17 *************** *** 1800,1804 **** bool CScintillaEx::SaveFile(LPCTSTR filename) { ! CharacterRange crange = GetSelection(); if (IsSelection()) SetSel(GetCurrentPos(), GetCurrentPos()); --- 1800,1809 ---- bool CScintillaEx::SaveFile(LPCTSTR filename) { ! // Save selection as line and column ! long nLineStart = LineFromPosition(GetSelectionStart()); ! long nColStart = GetColumn(GetSelectionStart()); ! long nLineEnd = LineFromPosition(GetSelectionEnd()); ! long nColEnd = GetColumn(GetSelectionEnd()); ! if (IsSelection()) SetSel(GetCurrentPos(), GetCurrentPos()); *************** *** 1819,1823 **** SetSavePoint(); ! SetSel(crange.cpMin, crange.cpMax); return bSuccess; } --- 1824,1833 ---- SetSavePoint(); ! // Restore selection ! SetSelectionStart(PositionFromLine(nLineStart) + nColStart); ! if (PositionFromLine(nLineEnd) + nColEnd > GetLineEndPosition(nLineEnd)) ! SetSelectionEnd(GetLineEndPosition(nLineEnd)); ! else ! SetSelectionEnd(PositionFromLine(nLineEnd) + nColEnd); return bSuccess; } |