Strange auto-indent behaviour

Strange auto-indent behaviour

2
NewbieNewbie
2

    Jul 21, 2006#1

    Kudos to the makers of this great editor! I believe that it is simply the best. But there is one small issue that I find rather irritating.

    I am coding in PL/I where I need to have my code within the 2 and the 72 column position so my code is kind of shifted one position to the right, but the auto indent seems to assume that every line should start on an even number position. If my line starts at an odd number column position, the auto indent does not work as I would expect. It seems that there is some kind of grid behind this, instead of calculating how much the next line should indent relating the previous line.

    Does anyone know how to work around this other than simply moving my code even further to the right?

    6,683583
    Grand MasterGrand Master
    6,683583

      Jul 21, 2006#2

      Have you enabled the option Use spaces in place of Tabs at Editor - Word Wrap/Tab Settings for the file extension used for PL/I files?

      If this setting is not enabled, UltraEdit inserts a horizontal tab and not 2 spaces. With a tab STOP value of 2 a tab character stops at every odd column with first column has number 1 or even column with first column has number 0.

      With the tab stop value(s) a hidden grid is build as it is also in MS Word for example.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Jul 21, 2006#3

        I tried your suggestion and it did not matter how the code looked, UltraEdit only used spaces instead of tabs. I had actually enabled the option "Use spaces in place of Tabs" before, but tried different combination of settings with this now and it did not help. Perhaps this problem of mine is something like a bug/feature is UltraEdit? I'm beginning to think so... :\

        6,683583
        Grand MasterGrand Master
        6,683583

          Jul 21, 2006#4

          You are right! I have not tested my answer which I normally do. The auto-indent feature never adds/removes the number of spaces to the start column of the current line. It uses really a fixed grid with the value of indent spaces or the tab stop values.

          Well, if the auto-indent feature is used consequently all lines start at a column on this "grid" and this effect will not be seen. (And it's also not seen if the indent space value is 1 which I use.)

          This handling is also described in help a little bit crypted:
          If the option to replace TABs with spaces is chosen, the editor inserts spaces in place of TABS but maintains the TAB stop spacing using the number of spaces specified. This applies to TAB characters entered after this setting is changed. Existing TAB characters in the document are not affected by these settings.
          I have also tried setting the tab stop value to 1 and indent spaces to 2 which should have the effect you want. But it also does not work. Maybe there is some like

          if ( UseSpacesInPlaceOfTabs && ( TabStopValue < IndentSpaces )) TabStopValue = IndentSpaces;

          You better create a backup of your file and use the ReIndent Selection feature to get the start of the lines on the "tab stop/indent grid".

          You can also write an email to IDM support and ask, if this behaviour is by design or a bug.
          Best regards from an UC/UE/UES for Windows user from Austria