Sfoglia il codice sorgente

"If virtual space is enabled, and tabs are not being used for indentation (typing in virtual space doesn't create tabs), then we don't actually have to set any indentation if the new line is empty; we can just move the caret out into virtual space."

This is actually not true. Pressing tab when in virtual space makes Scintilla move the caret back into non-virtual space, unlike when for example a letter is pressed. So if the user starts with typing a tab after the auto indent they have to redo the indentation themselves.
Martijn Laan 1 anno fa
parent
commit
7af99e0efb
1 ha cambiato i file con 3 aggiunte e 14 eliminazioni
  1. 3 14
      Projects/Src/CompForm.pas

+ 3 - 14
Projects/Src/CompForm.pas

@@ -4941,20 +4941,9 @@ begin
       end;
       end;
       if PreviousLine >= 0 then begin
       if PreviousLine >= 0 then begin
         PreviousIndent := FActiveMemo.GetLineIndentation(PreviousLine);
         PreviousIndent := FActiveMemo.GetLineIndentation(PreviousLine);
-        { If virtual space is enabled, and tabs are not being used for
-          indentation (typing in virtual space doesn't create tabs), then we
-          don't actually have to set any indentation if the new line is
-          empty; we can just move the caret out into virtual space. }
-        if (svsUserAccessible in FActiveMemo.VirtualSpaceOptions) and
-           not FActiveMemo.UseTabCharacter and
-           (FActiveMemo.Lines.RawLineLengths[NewLine] = 0) then begin
-          FActiveMemo.CaretVirtualSpace := PreviousIndent;
-        end
-        else begin
-          FActiveMemo.SetLineIndentation(NewLine, NewIndent + PreviousIndent);
-          FActiveMemo.CaretPosition := FActiveMemo.GetPositionFromLineExpandedColumn(NewLine,
-            PreviousIndent);
-        end;
+        FActiveMemo.SetLineIndentation(NewLine, NewIndent + PreviousIndent);
+        FActiveMemo.CaretPosition := FActiveMemo.GetPositionFromLineExpandedColumn(NewLine,
+          PreviousIndent);
       end;
       end;
     end;
     end;
   end;
   end;