Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Tabs and spaces in the G-code editor, encore

    Scheduled Pinned Locked Moved
    Duet Web Control
    1
    1
    115
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Schmartundefined
      Schmart
      last edited by

      Re: [DWC 3.2](gcode editor issue)

      Hi, I found the older topic referenced above mentioning that tabs should be replaced by spaces in the editor. However, while working intensively with conditional G-code/meta commands in the last couple of weeks (DWC 3.4.0 beta 5/6), I noticed this does not happen?

      I have to manually check the code with Visual Studio Code (search for \t) to prevent RRF complaining that spaces and tabs are mixed.

      Take the following code as a start:

      while {false}
      echo "Tab before line indent"
      echo "Selected line level 1 indent"
      echo "Selected line level 2 indent"
      
      • When I put the cursor in front of line 2 and press [Tab] → a tab character is inserted.
      • When I select line 3 with [Shift]+[Down] and press [Tab] → two spaces are inserted.
      • When I select line 4 with [Shift]+[Down] and press [Tab] twice → a tab character is inserted.

      So it looks like this now:

      1d21d81e-4ad0-43aa-b1b8-e1a093360332-image.png

      I would like that the built-in DWC editor converts indents into either spaces or tabs, but that it prevents a mix of both.

      P.S. I think two spaces are a good alternative to a space, but I know there's a camp that would prefer four spaces or tab characters only. So ultimately, a user setting for this would be nice.

      Creality CR-20 Pro with a Duet 2 Maestro, 3Dfused X+Z-axis rail kit, HIWIN-based DIY solution for the Y-axis, E3D Hemera, working ST7565 MiniPanel and various other small hardware improvements.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Unless otherwise noted, all forum content is licensed under CC-BY-SA