google / google/vimdoc

Don't split backtick-quoted strings in paragraphs

Aperta
#116 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
306
Fork
30
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con l’algoritmo di riformattazione dei paragrafi e riproduci il problema usando l’esempio Vimdoc presente in questo report. Verifica che gli snippet racchiusi tra backtick non vengano suddivisi su più righe e che l’output della guida generato mantenga il loro trattamento speciale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python, vim
Ambito
documentation, tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.