google / google/vimdoc

Don't split backtick-quoted strings in paragraphs

Abierto
#116 6 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
306
Forks
30
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con el algoritmo de redistribución de párrafos y reproduce el problema usando el ejemplo de Vimdoc de este informe. Verifica que los fragmentos entre backticks no se dividan entre líneas y que la salida de ayuda generada conserve su tratamiento especial.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, vim
Área
documentation, tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.