Skip to content

Don't split backtick-quoted strings in paragraphs #116

Description

@flwyd

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:

""                                                                               
" @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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions