Hi,

I searched a bit more, and am pretty sure it is a bug.  In synedit.pp
at line 9625
 Spaces := StringOfChar(' ', i);
overwrites what the previous line stored in the variable Spaces???
I commented it out and then noticed that the Tabs now get saved, but
there is still some problems.

1) After commenting out line 9625, everytime I press the tab key, a
pipe sign gets added to the end as well. Commenting out the addition
of the pipe sign on line 9624, the Tab charaters are not beings saved
anymore.  How weird?

2) Doing the above and have "Auto Indent" enabled, doesn't add tabs
but rather spaces to do the indenting.  I think the
CreateTabsAndSpaces function needs to be called near line 8008 and
8068 where StringOfChar is always called without checking if Tabs are
preffered or not.


I don't know the SynEdit code, but this is as much as I could figure
out.  Hope someone could find the solution based on what I found.  I
didn't manage to get it working 100% but at least managed to get
Lazarus to save Tab characters.  :)

Regards,
 Graeme.


PS:
 The patch below is *not* meant to be applied, only to show what
lines of code I was talking about.


-------------  synedit.pp.patch  --------------------
Index: synedit.pp
===================================================================
--- synedit.pp  (revision 9377)
+++ synedit.pp  (working copy)
@@ -9622,7 +9622,7 @@
  // i now contains the needed spaces
  Spaces := CreateTabsAndSpaces(CaretX,i,TabWidth,
                                not (eoTabsToSpaces in Options))+'|';
-  Spaces := StringOfChar(' ', i);
+//  Spaces := StringOfChar(' ', i);
  //debugln('TCustomSynEdit.DoTabKey Spaces="',DbgStr(Spaces),'"
TabChar=',DbgStr(TabChar));

  BeginUndoBlock;

-----------------  end  ---------------------------------


On 5/31/06, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:
Hi,

Before I create a bug report, I would like to confirm this (maybe
there is a IDE setting I missed).

I am using the latest SVN version of Lazarus under GNU/Linux compiled
with the GTK1 interface, updated this morning (9377).

If I edit a .pas file with gedit (Gnome Editor which supports tab
charaters for indentation) and use tabs instead of spaces for
indentation, Lazarus displays it correctly.  Lets say I used a tab
width of 8 in both gedit and Lazarus.

<t>   = tab
<s>  = space

--------------  sample pas file  --------------------
begin
<t>if (getGnome = null &
<t><s><s><s><s>getKDE = null)
<t>{
<t><t>// do something
<t><t>{ it has 2 tabs ahead }
<t>}
end.
------------------    end   --------------------------------

Now I edit this file in Lazarus, and add a third comment line and also
used 2 tabs infront of the comment.  Everything looks fine in Lazarus,
so I save.

Now I change gedits tab with to 4 and open that source file.  The
newly added line didn't line up with the other comments, because
spaces were inserted instead of tabs.

Another way of testing this is viewing that same file in Lazarus.  Go
to the editor options and change the Tab Width to 4.  All the lines
move, except the last line added using Lazarus.

Using the arrow keys, and pressing left or right, shows it is jumping
tabs, but again for that third comment line, it jumps single spaces.

Now in the editor options, I don't have the "Tabs to Spaces" ticked
and I don't have "Smart Tabs" ticked.  I attached a screenshot of my
Editor Settings for incase.

Is this a bug, or some setting I am missing somewhere?

PS:
Is there a setting to show Tab and Space charaters in the editor like
Delphi 7 does?


Regards,
  Graeme.


--
There's no place like 127.0.0.1





--
There's no place like 127.0.0.1

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to