Welcome, Guest
Username: Password: Remember me
Welcome to the XSharp forum!

Tell us and our members who you are, what you like and why you became a member of this site.
We welcome all new members and hope to see you around a lot!
  • Page:
  • 1

TOPIC:

Indentation 20 Sep 2022 20:37 #23934

  • KeesIC2
  • KeesIC2's Avatar
  • Topic Author


  • Posts: 49
  • Using version 2.13.2.2.

    My code is aligned left, starting at char 1. Let's take these lines for example:
    oImageColumn := DataGridViewImageColumn{}
    oImageColumn:HeaderText := ""
    oImageColumn:Name := "attachment"

    If I want to insert a line after the line in the middle, I place the cursor at the end of the line in the middle and press the Enter key. Then this happens:
    oImageColumn := DataGridViewImageColumn{}
    	oImageColumn:HeaderText := ""
    	
    oImageColumn:Name := "attachment"

    The second line now has a tab before it and the new line also begins with a tab. What could possibly be the logic in that? All lines are left aligned, why in the world are tabs inserted? I have turned off all indentation check boxes in Tools->Options->Text Editor->X#->Indentation but this did not help. Of course these lines are just examples, it happens everywhere and always.
    Does anyone know how to make this stop?

    Please Log in or Create an account to join the conversation.

    Indentation 20 Sep 2022 22:16 #23935

    • Chris
    • Chris's Avatar


  • Posts: 3652
  • Hi Kees,

    I think there's something wrong with modifying the indentation settings, I've also seen some fishy behavior in this area.

    Please restart VS and open again the indentation settings, make sure they are all disabled again (just to be sure, enable the "Indent statements inside entities" setting and then disable it again) and go back to the editor, it should work fine now. At least here, Enter on the existing lines does leave them in the beginning as intended now.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Indentation 21 Sep 2022 16:13 #23945

    • KeesIC2
    • KeesIC2's Avatar
    • Topic Author


  • Posts: 49
  • Hi Chris,

    Sorry, I can't get it to work. I did as you suggested, several times even, but no cigar. It drives me crazy and just as with the totally inadequate search option I wonder, how can people work like this? What am I doing wrong or what am I missing? Is there perhaps another setting somewhere else that controls the indenting? It seems that while all kinds of fancy stuff is added, the most basic functions do not work properly. I must say that I am seriously considering to use XIDE, providing that this has a better editor. XIDE can handle Winforms I think? Is it possible to use both VS and XIDE (not simultaneously of course) for a project?

    Please Log in or Create an account to join the conversation.

    Indentation 21 Sep 2022 16:51 #23946

    • Chris
    • Chris's Avatar


  • Posts: 3652
  • Hi Kees,

    No, I am afraid it will be extremely complicated to combine XIDE and VS in the same project, especially if you are using the winforms or WPF editor. That's not the solution, you just need to get used to working in VS, like millions other developers do (admittedly, I am not one myself though).

    Does this happen with all prgs that you have? CAn you send me a prg file to give it a try with? I think you said you disabled ALL options in the indentation settings, is that right?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Indentation 21 Sep 2022 17:27 #23952

    • robert
    • robert's Avatar


  • Posts: 3178
  • Guys,
    Please see my reply here:
    www.xsharp.eu/forum/public-product/3183-two-vs-issues

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Indentation 21 Sep 2022 17:45 #23954

    • KeesIC2
    • KeesIC2's Avatar
    • Topic Author


  • Posts: 49
  • Hi Robert,

    Thank you very much and I am sorry I did not see your reply in the other thread earlier, it would have saved me a lot of irritation. You wrote:

    2) Indenting during typing is controlled by the setting in Tools/Options Text Editor/X#/Tabs. If you set the option on this page to "None" then no indenting will happen during typing. If you set it to "Block " then each line will have the same indent as the previous line.

    That settings does fix it, both "Block" and "None" prevent the extra tabs. I think the "Smart" setting has room for improvement, to prevent unnecessary indenting as described.

    Please Log in or Create an account to join the conversation.

    Last edit: by KeesIC2.

    Indentation 22 Sep 2022 14:50 #23971

    • leon-ts
    • leon-ts's Avatar


  • Posts: 232
  • Hi Robert,
    I migrated to version 2.13.2.2 from version 2.9.1.1 and also noticed some oddities in the behavior of the VS editor, which are quite often evident. To visually show what happens when the Smart setting is enabled, I recorded a short video (attached). The video shows the pressed keys (for better analysis, it is recommended to turn on slow playback). Also attached a screenshot of the settings.
    For now, I've disabled Smart mode by setting the Tabs setting to Block. But I would like to hope that in future versions the Smart mode will work better.

    IDE: VS 2019 (16.11.19)
    X#: 2.13.2.2

    Indentation Settings (Tabs = Smart):


    Video:

    File Attachment:

    File Name: ScreenReco...ect1.zip
    File Size:7,024 KB


    Best regards,
    Leonid
    Attachments:

    Please Log in or Create an account to join the conversation.

    Indentation 22 Sep 2022 18:10 #23979

    • ic2
    • ic2's Avatar


  • Posts: 1553
  • Hello Leonid,

    I posted a similar issue, that Return and Local indent on the previous line when you press <Enter> where these should remain left, aligned with Method/Function, at least IMO.

    I wonder if you get the same issues as in the video when you uncheck all Indentation Settings? For me it didn't make any difference.

    Dick

    Please Log in or Create an account to join the conversation.

    Indentation 22 Sep 2022 19:02 #23980

    • leon-ts
    • leon-ts's Avatar


  • Posts: 232
  • Hello Dick,

    I wonder if you get the same issues as in the video when you uncheck all Indentation Settings? For me it didn't make any difference.

    When I unchecked all Indentation settings, the behavior of the editor changed inside NAMESPACE: new lines began to align relative to the previous line, regardless of what was in the line (entity definition or its body). But the behavior didn't change in any way outside of NAMESPACE (where I type the function definition at the end of the video): there is still an incomprehensible "dance" of the text.

    In general, for me, the preferred type of formatting is the one that is used in VO when applying auto-formatting (CTRL+ALT+I).
    FUNCTION <FuncName>
        LOCAL ...
        <BODY>
        RETURN
    I got used to it back in VO and also use it in X#.
    It also matches the way it is implemented in C#:


    Best regards,
    Leonid
    Attachments:

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1