this post was submitted on 26 May 2025
44 points (97.8% liked)

Programming

20365 readers
146 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
 

The comment does well in providing context and arguments.

Lets go back to the closest thing we have for requirements for this editor..Default CLI Editor - Feature Exploration!. This discussion was based on the current state of windows and was not concerned with UNIX.

Being a simple text editor, it should not hallucinate, it should not add text one did not type, it should not change the text that was typed. If the user typed a tab character, it was because the user wanted a tab character. If you want four spaces then type four spaces.

edit should by default work like the original namesake and not hallucinate or add characters that were not typed or make assumptions.

Where do you draw the line on "smart" features? Tab should not add indent spaces? Encoding or newline mechanisms? Determining EOF newline?

all 15 comments
sorted by: hot top controversial new old
[–] FizzyOrange 8 points 2 days ago

Depends what it's for. I think a simple CLI text editor like this probably shouldn't have any smarts. Obviously an IDE like VSCode or IntelliJ should.

[–] [email protected] 12 points 2 days ago* (last edited 2 days ago) (1 children)

Where do you draw the line on "smart" features? Tab should not add indent spaces? Encoding or newline mechanisms? Determining EOF newline?

For a very basic default editor, I would expect it to include only what I typed, no "smart" features, no IDE features, nothing else, and use CRLF (on Windows) for newlines with at most a setting to configure it in the editor for that session.

Basically, I wouldn't expect anything more than what nano does. If I want a fancy CLI editor, I'll install one. At its core though, it should exist only to edit the text content of a text file and do nothing else. It should be as stable as possible, and have as little scope as possible, in my opinion.

With that said, basic text editing features, like undo/redo and cut/copy/paste would be nice. Bonus points if it even works with the system clipboard.

Edit: to add to the question of whether an automatic newline should be added, Windows has no requirement for terminating text documents with newlines, so I would not expect one. What happens in POSIX environments by tools written for those environments seems irrelevant here - if a valid text document in POSIX must be terminated by a newline, then a text editor there would naturally be expected to add one, or at least support adding one, but that has nothing to do with Windows.

[–] Kissaki 1 points 2 days ago (1 children)

and use CRLF (on Windows) for newlines with at most a setting to configure it in the editor for that session

How would you handle text files with LF newlines being opened on Windows? Recognize and use LF too? Write CRLF on newly added lines? Save everything as CRLF, effectively transforming all LF?

[–] [email protected] 3 points 2 days ago (1 children)

I would expect it to use CRLF (on Windows) for all new newlines unless I tell it otherwise. It shouldn't try to be smart about it. It should just do exactly what I tell it to do and nothing more.

[–] JadedBlueEyes 1 points 16 hours ago

That wouldn't be what I would expect. Having mixed new lines in a file is generally a bad thing - the editor should pick one mode

[–] [email protected] 5 points 2 days ago (1 children)

The things the author mentioned drive me nuts about visual studio…. Especially trivial completions, like brace pairing, their thirst to add these newb-crutches leads me to backspacing and retyping over and over again, trying to figure out what the editor did that I didn’t even notice and how to undo it. For something that is literally a 20ms muscle memory action for any experienced programmer.

[–] Kissaki 2 points 2 days ago* (last edited 2 days ago)

Most of those can be disabled in Visual Studio, though, right?

I think I may have disabled some of those kinds of conveniences/automatisms.

[–] Kissaki 6 points 2 days ago

Given the announcement of edit replacing the old 32-bit MS-DOS edit.com with minimal footprint, I was surprised Microsoft considered multi-platform to even be in-scope.

I guess, given it's Rust, it was simple to say "sure, why not". But this ticket shows that you automatically have to discuss and handle multi-platform questions that arise.

[–] [email protected] 2 points 2 days ago (1 children)

MS, please take a look at Metapad for how to build a good basic text editor with some smart features.

[–] Kissaki 2 points 2 days ago* (last edited 2 days ago)

Metapad is a small, fast and completely free text editor for Windows (95/98/NT/XP/Vista/7) with similar features to Microsoft Notepad but with many extra (and rather useful) features. It was designed to completely replace Notepad since it includes all of Notepad's features and much, much more.

Oh, that's cool, in only 200 kB! It's a GUI app, though.

[–] JackbyDev 2 points 2 days ago

Just add .editorconfig support for insert_final_newline.

[–] [email protected] 1 points 2 days ago (1 children)

Honestly, pleasantly surprised that this piece of software exists. I didn't think that Microsoft's policy of "shove 'AI' into as many places as possible" was compatible with things such as having a functional text editor.

/s

[–] [email protected] 5 points 1 day ago (1 children)
[–] [email protected] 1 points 1 day ago

can't say i'm surprised but fuck that's funny