Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Languages.toml shouldn't have a todo.txt autoformatter #10113

Closed
heldrida opened this issue Apr 2, 2024 · 3 comments
Closed

Languages.toml shouldn't have a todo.txt autoformatter #10113

heldrida opened this issue Apr 2, 2024 · 3 comments
Labels
C-bug Category: This is a bug

Comments

@heldrida
Copy link

heldrida commented Apr 2, 2024

Summary

Hi, after updating to latest version helix 24.3 (2cadec0) and editing my daily note taking file, noticed that Helix modified it. Unfortunately the file is named "todo.txt" which matches to an autoformatter which targets "todo.txt".

This is a local file that I happen to use for note taking + todo list. I did not lost the data but the text is now "sorted" in such way that I lost the significance of notes.

I believe that this is bad user experience and we should not have this autoformater targeting "todo.txt".

Reproduction Steps

Edit a file with any content which is named todo.txt

hx todo.txt

Save

:w

The text should be sorted, which means that if you have text it'll be all over the place.

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

macOS

Terminal Emulator

alacritty

Installation Method

brew

Helix Version

helix 24.3 (2cadec0)

@heldrida heldrida added the C-bug Category: This is a bug label Apr 2, 2024
@archseer
Copy link
Member

archseer commented Apr 3, 2024

It's the intended behaviour of todo.tx though: https://github.com/todotxt/todo.txt/blob/master/README.md#complete-tasks-2-format-rules

@heldrida
Copy link
Author

heldrida commented Apr 3, 2024

@archseer I find this quite odd. If "todo.xt" is a thing, then should be opt-in by the user. If I want to sort my text, I can do it myself as Helix allows me to pipe to sort, I don't need an overqualified "todo.txt" plugin like behaviour meddling with my basic text files, which happens to match some opinionated obscure plugin.

postsolar pushed a commit to postsolar/helix that referenced this issue Apr 4, 2024
The file name is too common and can unintentionally conflict. Users
should manually opt in.

Fixes helix-editor#10113
postsolar pushed a commit to postsolar/helix that referenced this issue Apr 4, 2024
The file name is too common and can unintentionally conflict. Users
should manually opt in.

Fixes helix-editor#10113
postsolar pushed a commit to postsolar/helix that referenced this issue Apr 4, 2024
The file name is too common and can unintentionally conflict. Users
should manually opt in.

Fixes helix-editor#10113
postsolar pushed a commit to postsolar/helix that referenced this issue Apr 4, 2024
The file name is too common and can unintentionally conflict. Users
should manually opt in.

Fixes helix-editor#10113
postsolar pushed a commit to postsolar/helix that referenced this issue Apr 20, 2024
The file name is too common and can unintentionally conflict. Users
should manually opt in.

Fixes helix-editor#10113
mtoohey31 pushed a commit to mtoohey31/helix that referenced this issue Jun 2, 2024
The file name is too common and can unintentionally conflict. Users
should manually opt in.

Fixes helix-editor#10113
Vulpesx pushed a commit to Vulpesx/helix that referenced this issue Jun 7, 2024
The file name is too common and can unintentionally conflict. Users
should manually opt in.

Fixes helix-editor#10113
smortime pushed a commit to smortime/helix that referenced this issue Jul 10, 2024
The file name is too common and can unintentionally conflict. Users
should manually opt in.

Fixes helix-editor#10113
@nathanielknight
Copy link

nathanielknight commented Oct 3, 2024

I've also been bitten by this (e.g. I had my tasks sorted within each priority bucket and then that information was discarded by the formatter).

It's not clear to me from the linked definition that the file should necessarily be sorted: it mentions sorting lines as an example of something a user might want (which Helix can, of course, easily do), but the stated goal is:

A user can manipulate the file contents in a plain text editor in sensible, expected ways.

Anyways, here's a silly hack you can add to your languages.toml file to disable this feature:

[[language]]
name = "todotxt"
formatter = { command = "cat" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants