Nvim-R icon indicating copy to clipboard operation
Nvim-R copied to clipboard

Oxygen documentation of Oxygen documentation parsed incorrectly

Open zkamvar opened this issue 5 years ago • 0 comments

Hello,

I'm working on a package that would use oxygen documentation for processing and need to include oxygen syntax inside my oxygen documentation like so:

#' @examples
#' # parse text
#' 
#' txt <- parse_txt("#' An example
#' #' of parsed text
#' #' 
#' #' @sometag
#' #' 
#' #' Sometag attributes
#' #' ")
#' 
#' # the text is now parsed
#' txt

If I try to execute this in my session, None of the text beyond the first line is evaluated. Is there a way around this?

I attempted to look into common_global.vim, modifying CleanOxygenLine to use a lookbehind, but no luck:

function CleanOxygenLine(line)
    let cline = a:line
    if cline =~ "^\s*\\(#\\{1,2}'\s*\\)\\@<!#\\{1,2}'"
        let synName = synIDattr(synID(line("."), col("."), 1), "name")
        if synName == "rOExamples"
            let cline = substitute(cline, "^\s*\\(#\\{1,2}'\s*\\)\\@<!#\\{1,2}'", "", "")
        endif
    endif
    return cline
endfunction

zkamvar avatar Jun 15 '20 17:06 zkamvar