News for hackers. Stuff that matters.
Re:Kakoune Code Editor by thayne on Tuesday January 18, 2022 @01:17AM (#29975758)
I tried to use it enough to see if I could switch to it from (neo)vim. I liked a lot of the ideas in it, and in some ways I liked it more than vim, but it was missing some functionality that I just couldn't live without. Some things could be solved by plugins that just didn't exist yet, but others, I couldn't even see a way a plugin could be implemented. In particular, there isn't any way to get a diff mode comparable to vim's.

I also don't like that it always unconditionally writes a newline at the end of files. I understand the reasoning for it, but it makes it much more difficult to use as an editor for transformed binary files (gzip, hex editor, encrypted files, etc.) or avoid adding extra whitespace to git diffs when I modify files.

Re:Kakoune Code Editor by stjohnswarts on Tuesday January 18, 2022 @02:32AM (#29976187)
I don't understand the new line thing at the end. I haven't used a utility or app in -decades- that cared about whether you have a blank final line.
Re:Kakoune Code Editor by shric on Tuesday January 18, 2022 @06:44AM (#29977749)
There's a few reasons I can think of (some superficial, some significant):

- Github and git will highlight a missing newline in a diff by default.

- POSIX defines a line as having a newline at the end, so if you don't have a terminating new line you may have one fewer lines than you think you have [1]

- If you ever want to append to a text file/source file programmatically with something like echo "something at the end" >> yourfile.txt then you'll be grateful you had the habit of ending everything with a newline.

- If you use a shell that doesn't automatically add one when you do cat filename you'll end up with your prompt sitting awkwardly at the end of the file.

vim, iirc, defaults to automatically adding a newline to any file without you explicitly asking for it, unless you do set noeol and set binary or, in versions newer than 7.4, set nofixendofline

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1...

Re:Kakoune Code Editor by thayne on Tuesday January 18, 2022 @11:53AM (#29981901)
> vim, iirc, defaults to automatically adding a newline to any file without you explicitly asking for it, unless you do set noeol and set binary or, in versions newer than 7.4, set nofixendofline

which, IMO, is the right way to do it. In kakoune however, it isn't just the default, there is no way to turn it off.

Re:Kakoune Code Editor by ziml77 on Tuesday January 18, 2022 @03:47AM (#29976653)
I just ran into an issue with that recently. The Pandas library for Python doesn't consume the last line of a CSV unless it's followed by a new line. I would say I couldn't believe that it actually made inject that newline if it wasn't in the input, but Pandas has enough other oddities that it was pretty easy to believe.
Re:Kakoune Code Editor by xigoi on Tuesday January 18, 2022 @03:08AM (#29976407)
`cat`, for instance, definitely cares.
Re:Kakoune Code Editor by Someone on Tuesday January 18, 2022 @07:22AM (#29978026)
Do you ever do wc? It cares:

  > echo hello > hello
  > echo -n hello > hellon
  > wc hello hellon
         1       1       6 hello
         0       1       5 hellon
         1       2      11 total
Re:Kakoune Code Editor by gnubison on Thursday January 20, 2022 @12:26PM (#30011845)
Have you used cat recently? [Edit: scrolled down, looks like several other people already beat me to it. Whoops.]
Re:Kakoune Code Editor by usefulcat on Tuesday January 18, 2022 @09:26AM (#29979570)
I think it used to be a requirement (technically) for C and C++, though probably not much any more in practice.
Re:Kakoune Code Editor by jeffreygoesto on Tuesday January 18, 2022 @05:01AM (#29977101)
The GreenHills C++ compiler does. It's a niche product, admitted.
Re:Kakoune Code Editor by 3836293648 on Tuesday January 18, 2022 @05:48PM (#29987237)
Literally cat
Re:Kakoune Code Editor by draxil on Tuesday January 18, 2022 @05:25AM (#29977236)
breaks some crontabs.