diff: accepted text differs from :w in corner cases of 'fileformat' and 'fileformats'
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
Start with the diff acceptance code and the neovim_writes oracle in tests/integration/diff_accept_crlf_spec.lua. Compare proposal splitting and joining against readfile and :w for the listed fileformat and fileformats cases, including cases 4 and 5 whose scope still awaits a maintainer decision. Done means accepted text matches :w across the reported cases and the integration tests cover them.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
The text that a split-layout diff accepts can differ from what :w writes for the same buffer in some corner cases of 'fileformat' and 'fileformats'. Each case below exists on main before #577 too. #577 fixes the common cases (CRLF proposals under the default 'fileformats', and an unedited proposal under any 'fileformats') and leaves these for a follow-up.
ff=macwith a CR inside a line::wwrites that CR as NL, the accepted text keeps it."a\rb\n"then:setlocal ff=macgives"a\rb\r", while:wgives"a\nb\r".mainjoined with LF, which is also wrong. Codex flagged this on #577 (diff.lua, "Translate embedded CR bytes before joining Mac lines").set ffs=unix,mac: Neovim reads, for example,"a\r\nb\r\r\n"as mac, but the diff never detects mac. In 24ff=macedit cases,main's answer equals a file-read oracle and #577's does not. Both differ from:wof the same buffer.- Empty proposal, then typed lines:
'eol'stays off (#542), soGoxgives"\nx", while:wof an empty file gives"\nx\n". 'fileformats'starting withdosand a proposal with no LF ("","a","a\r"): Neovim reads it as dos, the diff keeps unix, so a typed line gets LF where:wwrites CRLF.set ffs=dos(one entry): Neovim reads every file as dos, an LF file too. An LF or mixed proposal stays unix, so a typed line gets LF where:wof the file writes CRLF.
Fix direction: one function that decides 'fileformat' and splits the proposal the way readfile does (empty value: 'fileformat'; one entry: forced; several entries: dos unless a lone LF, mac when there are more CRs than LFs, the first entry when there is no LF), plus a join that translates CRs for mac. The neovim_writes oracle in tests/integration/diff_accept_crlf_spec.lua (#577) can be reused.
Evidence: a probe of 1860 cases per run on Neovim 0.12.3 and 0.8.0, under 'fileformats' unix,dos, dos,unix, unix, dos and unix,mac. Mismatches with :w left on #577 (on main): 144 (748), 184 (788), 192 (304), 516 (1104), 544 (608).
The maintainer agreed to defer items 1 and 3 (and item 2, which belongs to item 1) from the README verification run. Items 4 and 5, and item 6 in the comment below, were found later and still wait for the maintainer's decision: fix them in this run or defer them here.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- Langage dominant
- Lua
- Étoiles
- 3.2k
- Forks
- 223
- Merge moyen
- 6 h 7 min
- PR mergées (30 j)
- 210
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de coder/claudecode.nvim
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
coder/claudecode.nvim#588 ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
coder/claudecode.nvim#587 ·
Les mainteneurs répondent en général sous 1 jour
-
bug needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
coder/claudecode.nvim#313 ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 4/5 3-5 jours Accessibilité débutants 56/100
coder/claudecode.nvim#590 ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 4/5 3-5 jours Accessibilité débutants 56/100
coder/claudecode.nvim#589 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de coder/claudecode.nvim
Issues similaires
-
documentation night-shift
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
nvim-telescope/telescope.nvim#3718 ·
Les mainteneurs répondent en général sous 1 jour
-
leatherworking is wrongOuvertebug discord guide:leatherworking locale:enUS triage v0.3.6
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
Seeking Caitlin (95737) should be a breadcrumb: still shown after the follow-up is completedOuverteData Correction Forever
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Les mainteneurs répondent en général sous 1 jour