mirror of https://gitlab.com/basile.b/dexed.git
fix, dcd ddoc mouse hint, decl finder, location is not based on the speific document line ending kind but on the system one
This commit is contained in:
parent
ac82a0aba8
commit
6aed308035
|
@ -205,10 +205,8 @@ type
|
||||||
function AppIsRunning(const ExeName: string):Boolean;
|
function AppIsRunning(const ExeName: string):Boolean;
|
||||||
|
|
||||||
(**
|
(**
|
||||||
* Returns the length of the line ending in aFilename;
|
* Returns the length of the line ending of the system
|
||||||
*)
|
*)
|
||||||
//function getLineEndingLength(const aFilename: string): byte;
|
|
||||||
|
|
||||||
function getSysLineEndLen: byte;
|
function getSysLineEndLen: byte;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
@ -758,36 +756,6 @@ begin
|
||||||
aProcess.Options := aProcess.Options + [poNewConsole];
|
aProcess.Options := aProcess.Options + [poNewConsole];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TODO-cbugfix: confirm that DCD location info are based on system Line ending and not the one existing in a specific file
|
|
||||||
|
|
||||||
//function getLineEndingLength(const aFilename: string): byte;
|
|
||||||
//var
|
|
||||||
// value: char;
|
|
||||||
// le: string;
|
|
||||||
//begin
|
|
||||||
// value := #0;
|
|
||||||
// le := LineEnding;
|
|
||||||
// result := length(le);
|
|
||||||
// if not fileExists(aFilename) then
|
|
||||||
// exit;
|
|
||||||
// with TMemoryStream.Create do
|
|
||||||
// try
|
|
||||||
// LoadFromFile(aFilename);
|
|
||||||
// while true do
|
|
||||||
// begin
|
|
||||||
// if Position = Size then
|
|
||||||
// exit;
|
|
||||||
// read(value,1);
|
|
||||||
// if value = #10 then
|
|
||||||
// exit(1);
|
|
||||||
// if value = #13 then
|
|
||||||
// exit(2);
|
|
||||||
// end;
|
|
||||||
// finally
|
|
||||||
// Free;
|
|
||||||
// end;
|
|
||||||
//end;
|
|
||||||
|
|
||||||
function getSysLineEndLen: byte;
|
function getSysLineEndLen: byte;
|
||||||
begin
|
begin
|
||||||
{$IFDEF WINDOWS}
|
{$IFDEF WINDOWS}
|
||||||
|
|
|
@ -375,10 +375,7 @@ begin
|
||||||
openDocument(fname);
|
openDocument(fname);
|
||||||
if srcpos <> -1 then
|
if srcpos <> -1 then
|
||||||
begin
|
begin
|
||||||
// note: SelStart only matches srcpos if the target file has the same line ending
|
|
||||||
// as the operating system: the pos has to be found manually.
|
|
||||||
sum := 0;
|
sum := 0;
|
||||||
//len := getLineEndingLength(fDoc.fileName);
|
|
||||||
len := getSysLineEndLen;
|
len := getSysLineEndLen;
|
||||||
for i := 0 to fDoc.Lines.Count-1 do
|
for i := 0 to fDoc.Lines.Count-1 do
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -620,9 +620,9 @@ var
|
||||||
i, len: Integer;
|
i, len: Integer;
|
||||||
begin
|
begin
|
||||||
result := 0;
|
result := 0;
|
||||||
//len := getLineEndingLength(fFilename);
|
len := getSysLineEndLen;
|
||||||
for i:= 0 to fMousePos.y-2 do
|
for i:= 0 to fMousePos.y-2 do
|
||||||
result += length(Lines.Strings[i]) + getSysLineEndLen;
|
result += length(Lines.Strings[i]) + len;
|
||||||
result += fMousePos.x;
|
result += fMousePos.x;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue