4 ms·
> Changes are tracked by line which is equivalent to a paragraph in a book. When using Markdown, I usually split paragraphs over multiple lines (usually betwee
by nadaviv 13y ago
> Changes are tracked by line which is equivalent to a paragraph in a book.
When using Markdown, I usually split paragraphs over multiple lines (usually between sentences) which makes diffs much easier to read, while still rendering as a single paragraph.
- vidarh 13y agoSame here. "Single line paragraphs" are a pet hate of mine - they have no place in plain text files even if those files are intended to be post-processed.
- tasuki 13y agoI'm still undecided on this. Say you have a long paragraph and have to add one word at the beginning. You have two options - either rewrap and introduce a silly diff, or don't rewrap and exceed your chosen text width. Single line paragraphs don't put such a difficult choice in front of you. If your diff software is any useful, it'll highlight your change within the line.
- gknoy 13y agoPerhaps you could have a special kind of commit, a "text-rewrap" commit (similar to merge commits), which might let your diff presentation tool alternate between diffing lines, pararaphs, or the like. I agree, the presentation layer really needs to be as granular as your editing team needs to be. I __really__ like how Github shows the differences within a line that is different.
- nadaviv 13y agoThat's why I don't use fixed-width. I break lines up logically, usually at the end of a phrase/sentence, regardless of their length.
- breadbox 13y agoAbsolutely, but you still have the issue that a minor wording change can cause an entire paragraph to be marked as changed if your editor re-wraps the paragraph. Or, if the editor doesn't rewrap the paragraph, then they slowly get more and more ragged over time, making it annoying to read through. A diff tool that understands paragraphs is an essential tool for this project.
- gabemart 13y agoI disagree with this. In a plain text file that consists of prose, line breaks are presentation, not content. Hardcoding them into the file doesn't appeal to me. It makes editing a pain in the neck. It also means the line breaks have to be removed again if you want to move between formats.
- gknoy 13y agoThat sounds like an editor issue, though. You should be able to reflow a paragraph, indent it or whatever it as you like. A compromise might be to break lines on sentence boundaries: edits are often constrained within sentence or paragraph boundaries, and then diff would give more meaningful output for most sentences. ^-- This one sentence is two lines long, though, so perhaps my idea is not that good. Diffs would still be easier to read than if each paragraph were one line.
- jamie_ca 13y agoI know people who break lines per phrase/clause, rather than per sentence. You wind up with lots of very short lines, but that doesn't matter after Markdown is done processing. The benefit is some _very_ granular diffs that are easy to read, as you work out rewording things in the editing process.