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?

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    12
    ·
    edit-2
    4 days ago

    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@programming.devOP
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      4 days ago

      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?

      • TehPers@beehaw.org
        link
        fedilink
        English
        arrow-up
        3
        ·
        4 days ago

        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.

        • Jade@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          2 days 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