helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
34k stars 2.51k forks source link

Should Use Tabs for Makefiles by Default #12112

Closed enkvadrat closed 2 days ago

enkvadrat commented 5 days ago

Summary

Helix currently inserts spaces instead of tabs when editing Makefile files. This causes errors with make, as it requires commands to be indented with tabs.

Reproduction Steps

  1. Open a Makefile in Helix and add:
    all:
       echo "Hello"  # Indented with spaces by default
  2. Save and check indentation using:
    cat -T Makefile
    • Tabs show as ^I, spaces are invisible.
  3. Run make:
    make

    Observe the error:

    Makefile:2: *** missing separator.  Stop.

Helix log

No response

Platform

Linux

Terminal Emulator

st

Installation Method

pacman

Helix Version

helix 24.7

enkvadrat commented 5 days ago

12109 is maybe related

RoloEdits commented 5 days ago

when I have

all:echo "Hello"

and then put my cursor before echo and press return I get the expected tab.

all:
    echo "Hello"

When I initially tried to replicate I also got the expected tab.

pascalkuthe commented 4 days ago

Helix autodetects indentation when opening an existing file so most likely you opened a makefile that already had spaces in it