Skip to content

Broken auto indent behavior in raw text editor #4650

Closed

Description

@KabanFriends

To Reproduce

  1. Create a "Compose" type project
  2. Set the compose provider to "Raw"
  3. Write several lines of YML
  • Add indentations (tab key)
  • Press Enter to add a newline while on an indented line

Current vs. Expected behavior

Expected

  • Auto indents added after newlines should match the current indent level (2, 4, 6 spaces etc.)

Current

  • It appends inconsistent number of spaces and messes up the indent level; sometimes it adds odd-numbered amount of spaces too

Provide environment information

Dokploy version: `v0.29.8`

Which area(s) are affected? (Select all that apply)

Application

Are you deploying the applications where Dokploy is installed or on a remote server?

Both

Additional context

Auto indents were working few months ago; I am not sure which exact update broke it

Will you send a PR to fix it?

Maybe, need help

Activity

  1. Ritinder-Singh commented on Jun 23, 2026

    @Ritinder-Singh

    I'd like to take a stab at this. Will dig into the editor config and report back.

  2. Siumauricio commented on Jul 21, 2026

    @Siumauricio
    Contributor

    Reproduced this in the browser on the compose Raw editor. Concrete case:

    • Line ports: has 4 spaces of indentation.
    • Placing the cursor at end of line and pressing Enter produces a new line with 10 spaces of leading indentation (should be 4, matching the current level).

    So the auto-indent is definitely miscomputing the indent (confirmed the 10-space output, no tabs involved).

    The editor is CodeMirror 6 (@uiw/react-codemirror + @codemirror/lang-yaml) in apps/dokploy/components/shared/code-editor.tsx, with no explicit indentation config. I tried the obvious fix — setting tabSize: 2 in basicSetup and adding indentUnit.of(" ") — but it did not change the behavior (still 10 spaces). That means the extra indentation is coming from the YAML language's indent service itself (@codemirror/lang-yaml), not from an indentUnit/tabSize mismatch, so it likely needs either a pinned/updated @codemirror/lang-yaml version or an explicit indentService override rather than a one-line config tweak.

    I'm not opening a PR with a fix I couldn't verify actually works. Leaving this documented for a maintainer who can decide between (a) pinning the codemirror YAML packages to the versions from before the regression, or (b) adding a custom YAML indentService.

    Marking awaiting-feedback.

  3. Siumauricio commented on Jul 21, 2026

    @Siumauricio
    Contributor

    Note: there's already an open PR for this — #4828 (fix(editor): consistent YAML auto-indent on newline). It likely supersedes my analysis above; deferring to that PR.

  4. added a commit that references this issue on Aug 11, 2026
    7ca96f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions