mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 00:59:21 +02:00
fixed jumping to end of tab line
git-svn-id: trunk@6544 -
This commit is contained in:
parent
0411877119
commit
7008387821
@ -163,7 +163,7 @@ type
|
|||||||
eoAutoSizeMaxScrollWidth, //TODO Automatically resizes the MaxScrollWidth property when inserting text
|
eoAutoSizeMaxScrollWidth, //TODO Automatically resizes the MaxScrollWidth property when inserting text
|
||||||
eoDisableScrollArrows, //TODO Disables the scroll bar arrow buttons when you can't scroll in that direction any more
|
eoDisableScrollArrows, //TODO Disables the scroll bar arrow buttons when you can't scroll in that direction any more
|
||||||
eoDragDropEditing, // Allows you to select a block of text and drag it within the document to another location
|
eoDragDropEditing, // Allows you to select a block of text and drag it within the document to another location
|
||||||
eoDropFiles, //TODO Allows the editor accept OLE file drops
|
eoDropFiles, //TODO Allows the editor accept file drops
|
||||||
eoEnhanceHomeKey, //TODO enhances home key positioning, similar to visual studio
|
eoEnhanceHomeKey, //TODO enhances home key positioning, similar to visual studio
|
||||||
eoGroupUndo, //TODO When undoing/redoing actions, handle all continous changes of the same kind in one call instead undoing/redoing each command separately
|
eoGroupUndo, //TODO When undoing/redoing actions, handle all continous changes of the same kind in one call instead undoing/redoing each command separately
|
||||||
eoHalfPageScroll, // When scrolling with page-up and page-down commands, only scroll a half page at a time
|
eoHalfPageScroll, // When scrolling with page-up and page-down commands, only scroll a half page at a time
|
||||||
@ -171,7 +171,7 @@ type
|
|||||||
eoKeepCaretX, // When moving through lines w/o Cursor Past EOL, keeps the X position of the cursor
|
eoKeepCaretX, // When moving through lines w/o Cursor Past EOL, keeps the X position of the cursor
|
||||||
eoNoCaret, // Makes it so the caret is never visible
|
eoNoCaret, // Makes it so the caret is never visible
|
||||||
eoNoSelection, // Disables selecting text
|
eoNoSelection, // Disables selecting text
|
||||||
eoRightMouseMovesCursor, //TODO When clicking with the right mouse for a popup menu, move the cursor to that location
|
eoRightMouseMovesCursor, // When clicking with the right mouse for a popup menu, move the cursor to that location
|
||||||
eoScrollByOneLess, // Forces scrolling to be one less
|
eoScrollByOneLess, // Forces scrolling to be one less
|
||||||
eoScrollHintFollows, //TODO The scroll hint follows the mouse when scrolling vertically
|
eoScrollHintFollows, //TODO The scroll hint follows the mouse when scrolling vertically
|
||||||
eoScrollPastEof, // Allows the cursor to go past the end of file marker
|
eoScrollPastEof, // Allows the cursor to go past the end of file marker
|
||||||
@ -181,7 +181,7 @@ type
|
|||||||
eoSmartTabDelete, //TODO similar to Smart Tabs, but when you delete characters
|
eoSmartTabDelete, //TODO similar to Smart Tabs, but when you delete characters
|
||||||
eoSmartTabs, // When tabbing, the cursor will go to the next non-white space character of the previous line
|
eoSmartTabs, // When tabbing, the cursor will go to the next non-white space character of the previous line
|
||||||
eoSpecialLineDefaultFg, //TODO disables the foreground text color override when using the OnSpecialLineColor event
|
eoSpecialLineDefaultFg, //TODO disables the foreground text color override when using the OnSpecialLineColor event
|
||||||
eoTabIndent, //TODO When active <Tab> and <Shift><Tab> act as block indent, unindent when text is selected
|
eoTabIndent, // When active <Tab> and <Shift><Tab> act as block indent, unindent when text is selected
|
||||||
eoTabsToSpaces, // Converts a tab character to a specified number of space characters
|
eoTabsToSpaces, // Converts a tab character to a specified number of space characters
|
||||||
eoTrimTrailingSpaces, // Spaces at the end of lines will be trimmed and not saved
|
eoTrimTrailingSpaces, // Spaces at the end of lines will be trimmed and not saved
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
@ -2058,10 +2058,13 @@ begin
|
|||||||
Include(fStateFlags, sfWaitForDragging)
|
Include(fStateFlags, sfWaitForDragging)
|
||||||
else begin
|
else begin
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
if ([sfDblClicked,sfTripleClicked,sfQuadClicked]*fStateFlags=[]) then begin
|
if ((Button=mbLeft)
|
||||||
|
or ((eoRightMouseMovesCursor in Options) and (Button=mbRight)))
|
||||||
|
and ([sfDblClicked,sfTripleClicked,sfQuadClicked]*fStateFlags=[])
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
if (sfDblClicked in fStateFlags) then begin
|
if (sfDblClicked in fStateFlags)
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
then begin
|
||||||
if ssShift in Shift then
|
if ssShift in Shift then
|
||||||
SetBlockEnd({$IFDEF SYN_LAZARUS}LogCaretXY
|
SetBlockEnd({$IFDEF SYN_LAZARUS}LogCaretXY
|
||||||
{$ELSE}CaretXY{$ENDIF})
|
{$ELSE}CaretXY{$ENDIF})
|
||||||
@ -2078,23 +2081,25 @@ begin
|
|||||||
end;
|
end;
|
||||||
{end} //mh 2000-11-20
|
{end} //mh 2000-11-20
|
||||||
end;
|
end;
|
||||||
{$IFDEF SYN_LAZARUS}
|
|
||||||
if Button=mbMiddle then begin
|
|
||||||
if SelAvail then begin
|
|
||||||
fUndoList.AddChange(crDelete, fBlockBegin, fBlockEnd, SelText,
|
|
||||||
SelectionMode);
|
|
||||||
end;
|
|
||||||
StartOfBlock := minPoint(fBlockBegin, fBlockEnd);
|
|
||||||
EndOfBlock := maxPoint(fBlockBegin, fBlockEnd);
|
|
||||||
fBlockBegin := StartOfBlock;
|
|
||||||
fBlockEnd := EndOfBlock;
|
|
||||||
LockUndo;
|
|
||||||
SelText := PrimarySelText;
|
|
||||||
UnlockUndo;
|
|
||||||
fUndoList.AddChange(crPaste, StartOfBlock, BlockEnd, SelText, smNormal);
|
|
||||||
end;
|
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
if (Button=mbMiddle)
|
||||||
|
and ([sfDblClicked,sfTripleClicked,sfQuadClicked]*fStateFlags=[])
|
||||||
|
then begin
|
||||||
|
if SelAvail then begin
|
||||||
|
fUndoList.AddChange(crDelete, fBlockBegin, fBlockEnd, SelText,
|
||||||
|
SelectionMode);
|
||||||
|
end;
|
||||||
|
StartOfBlock := minPoint(fBlockBegin, fBlockEnd);
|
||||||
|
EndOfBlock := maxPoint(fBlockBegin, fBlockEnd);
|
||||||
|
fBlockBegin := StartOfBlock;
|
||||||
|
fBlockEnd := EndOfBlock;
|
||||||
|
LockUndo;
|
||||||
|
SelText := PrimarySelText;
|
||||||
|
UnlockUndo;
|
||||||
|
fUndoList.AddChange(crPaste, StartOfBlock, BlockEnd, SelText, smNormal);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
if (X < fGutterWidth) then
|
if (X < fGutterWidth) then
|
||||||
@ -6824,22 +6829,23 @@ begin
|
|||||||
ecLineStart, ecSelLineStart:
|
ecLineStart, ecSelLineStart:
|
||||||
begin
|
begin
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
MoveCaretAndSelectionPhysical
|
MoveCaretAndSelectionPhysical(CaretXY,Point(1, CaretY),
|
||||||
|
Command = ecSelLineStart);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
MoveCaretAndSelection
|
MoveCaretAndSelection(CaretXY,Point(1, CaretY), Command = ecSelLineStart);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
(CaretXY,Point(1, CaretY), Command = ecSelLineStart);
|
|
||||||
fLastCaretX := fCaretX;
|
fLastCaretX := fCaretX;
|
||||||
end;
|
end;
|
||||||
ecLineEnd, ecSelLineEnd:
|
ecLineEnd, ecSelLineEnd:
|
||||||
begin
|
begin
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
MoveCaretAndSelectionPhysical
|
MoveCaretAndSelectionPhysical(CaretXY,
|
||||||
{$ELSE}
|
LogicalToPhysicalPos(Point(1 + Length(LineText), CaretY)),
|
||||||
MoveCaretAndSelection
|
|
||||||
{$ENDIF}
|
|
||||||
(CaretXY, Point(1 + Length(LineText), CaretY),
|
|
||||||
Command = ecSelLineEnd);
|
Command = ecSelLineEnd);
|
||||||
|
{$ELSE}
|
||||||
|
MoveCaretAndSelection(CaretXY, Point(1 + Length(LineText), CaretY),
|
||||||
|
Command = ecSelLineEnd);
|
||||||
|
{$ENDIF}
|
||||||
fLastCaretX := fCaretX;
|
fLastCaretX := fCaretX;
|
||||||
end;
|
end;
|
||||||
{end} //mh 2000-10-19
|
{end} //mh 2000-10-19
|
||||||
@ -7336,7 +7342,11 @@ begin
|
|||||||
ecTab:
|
ecTab:
|
||||||
if not ReadOnly then DoTabKey;
|
if not ReadOnly then DoTabKey;
|
||||||
ecShiftTab:
|
ecShiftTab:
|
||||||
if not ReadOnly then { ??? };
|
if not ReadOnly then
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
if SelAvail and (eoTabIndent in Options) then
|
||||||
|
DoBlockUnindent
|
||||||
|
{$ENDIF};
|
||||||
ecMatchBracket:
|
ecMatchBracket:
|
||||||
FindMatchingBracket;
|
FindMatchingBracket;
|
||||||
ecChar:
|
ecChar:
|
||||||
@ -8547,6 +8557,7 @@ end;
|
|||||||
procedure TCustomSynEdit.MoveCaretAndSelection(
|
procedure TCustomSynEdit.MoveCaretAndSelection(
|
||||||
{$IFDEF SYN_LAZARUS}const {$ENDIF}ptBefore, ptAfter: TPoint;
|
{$IFDEF SYN_LAZARUS}const {$ENDIF}ptBefore, ptAfter: TPoint;
|
||||||
SelectionCommand: boolean);
|
SelectionCommand: boolean);
|
||||||
|
// ptBefore and ptAfter are logical (byte)
|
||||||
begin
|
begin
|
||||||
IncPaintLock;
|
IncPaintLock;
|
||||||
if SelectionCommand then begin
|
if SelectionCommand then begin
|
||||||
@ -8645,6 +8656,12 @@ var
|
|||||||
NewCaretX: integer; //mh 2000-10-01
|
NewCaretX: integer; //mh 2000-10-01
|
||||||
ChangeScroll: boolean; //mh 2000-10-01
|
ChangeScroll: boolean; //mh 2000-10-01
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
if (eoTabIndent in Options) and SelAvail then begin
|
||||||
|
DoBlockIndent;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
i := 0;
|
i := 0;
|
||||||
if eoSmartTabs in fOptions then begin
|
if eoSmartTabs in fOptions then begin
|
||||||
iLine := CaretY - 1;
|
iLine := CaretY - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user