Don't split backtick-quoted strings in paragraphs
- Vorherrschende Sprache
- Python
- Sterne
- 306
- Forks
- 30
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Vim help syntax recognizes backtick-quoted strings as short code snippets. It doesn't show the backticks, and applies a highlight group. However, it appears to only recognize these quotes if they appear on a single line. Vimdoc's paragraph algorithm will reflow comment text without regard to backtick placement, which can lead a snippet to be awkwardly split across two lines, losing the special treatment in the help buffer.
Example:
```vim
""
" @public
" @dict Lexer
" Attempts to read an identifier at the current position, returning a
" @dict(Token) with `type = 'identifier'` if successful and an empty dict
" otherwise. By default, this calls
" `self.ReadPatternAs('\v^\k+', 'identifier')` Language-specific lexers may
" set a different ReadIdentifier function property.
function! foo#ReadIdentifier() abort dict
" ...
endfunction
```
Vimdoc turns this into
```
Lexer.ReadIdentifier() *Lexer.ReadIdentifier()*
Attempts to read an identifier at the current position, returning a
|foo.Token| with `type = 'identifier'` if successful and an empty dict
otherwise. By default, this calls `self.ReadPatternAs('\v^\k+',
'identifier')` Language-specific lexers may set a different ReadIdentifier
function property.
```
Beitragsleitfaden
Rechercherichtung
Beginne mit dem Absatzumbruchalgorithmus und reproduziere das Problem anhand des Vimdoc-Beispiels in diesem Bericht. Überprüfe, dass in Backticks eingeschlossene Snippets nicht auf mehrere Zeilen aufgeteilt werden und dass die erzeugte Hilfeausgabe ihre besondere Behandlung beibehält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, vim
- Bereich
- documentation, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100