mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 08:51:17 +02:00
SynEdit: Appending to End of line (while TrimTrailingSpaces is off) would add an extra space
git-svn-id: trunk@17402 -
This commit is contained in:
parent
bd34666528
commit
a024e783ba
@ -8311,12 +8311,6 @@ begin
|
|||||||
{end} //mh 2000-11-20
|
{end} //mh 2000-11-20
|
||||||
end else begin
|
end else begin
|
||||||
Temp := LineText;
|
Temp := LineText;
|
||||||
// Added the check for whether or not we're in insert mode.
|
|
||||||
// If we are, we append one less space than we would in overwrite mode.
|
|
||||||
// This is because in overwrite mode we have to put in a final space
|
|
||||||
// character which will be overwritten with the typed character. If we put the
|
|
||||||
// extra space in in insert mode, it would be left at the end of the line and
|
|
||||||
// cause problems unless eoTrimTrailingSpaces is set.
|
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
LogCaretXY:=PhysicalToLogicalPos(CaretXY);
|
LogCaretXY:=PhysicalToLogicalPos(CaretXY);
|
||||||
{debugln('ecChar CaretXY=',dbgs(CaretXY),
|
{debugln('ecChar CaretXY=',dbgs(CaretXY),
|
||||||
@ -8340,8 +8334,8 @@ begin
|
|||||||
CaretX := InsertChar(aChar, Temp, CaretX, drLTR);
|
CaretX := InsertChar(aChar, Temp, CaretX, drLTR);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Len := Length(Temp);
|
Len := Length(Temp);
|
||||||
if Len < LogCaretXY.X then
|
if Len < LogCaretXY.X - 1 then
|
||||||
Temp := Temp + StringOfChar(' ', LogCaretXY.X - Len);
|
Temp := Temp + StringOfChar(' ', LogCaretXY.X - 1 - Len);
|
||||||
System.Insert(AChar, Temp, LogCaretXY.X);
|
System.Insert(AChar, Temp, LogCaretXY.X);
|
||||||
//debugln('ecChar Temp=',DbgStr(Temp),' AChar=',DbgStr(AChar));
|
//debugln('ecChar Temp=',DbgStr(Temp),' AChar=',DbgStr(AChar));
|
||||||
CaretX := CaretX + 1;
|
CaretX := CaretX + 1;
|
||||||
@ -8380,6 +8374,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ELSE below for NOT SYN_LAZARUS ----------------------------------}
|
{$ELSE below for NOT SYN_LAZARUS ----------------------------------}
|
||||||
bChangeScroll := not (eoScrollPastEol in fOptions);
|
bChangeScroll := not (eoScrollPastEol in fOptions);
|
||||||
|
// Added the check for whether or not we're in insert mode.
|
||||||
|
// If we are, we append one less space than we would in overwrite mode.
|
||||||
|
// This is because in overwrite mode we have to put in a final space
|
||||||
|
// character which will be overwritten with the typed character. If we put the
|
||||||
|
// extra space in in insert mode, it would be left at the end of the line and
|
||||||
|
// cause problems unless eoTrimTrailingSpaces is set.
|
||||||
try
|
try
|
||||||
if bChangeScroll then Include(fOptions, eoScrollPastEol);
|
if bChangeScroll then Include(fOptions, eoScrollPastEol);
|
||||||
StartOfBlock := CaretXY;
|
StartOfBlock := CaretXY;
|
||||||
|
Loading…
Reference in New Issue
Block a user