"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/plugins/terminal_add_info.lua" (12 May 2020, 825 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lua source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 --[[
    2 
    3 Sample plugin file for highlight 3.45
    4 ]]
    5 
    6 Description="Adds file information to terminal output (ansi, xterm, truecolor)"
    7 
    8 Categories = {"format", "ansi", "xterm", "truecolor" }
    9 
   10 function formatUpdate(desc)
   11 
   12     function DocumentHeader(numFiles, currFile, options)
   13         if (HL_OUTPUT == HL_FORMAT_ANSI or HL_OUTPUT == HL_FORMAT_XTERM256 or HL_OUTPUT==HL_FORMAT_TRUECOLOR) then
   14             return  ">>> FILE "..string.format("%d",currFile).."/"..string.format("%d", numFiles).." ".. options.title .. ":\n"
   15         end
   16     end
   17 
   18     function DocumentFooter(numFiles, currFile, options)
   19         if (HL_OUTPUT == HL_FORMAT_ANSI or HL_OUTPUT == HL_FORMAT_XTERM256 or HL_OUTPUT==HL_FORMAT_TRUECOLOR) then
   20             return ">>>END OF FILE\n"
   21         end
   22     end
   23 
   24 end
   25 
   26 Plugins={
   27 
   28   { Type="format", Chunk=formatUpdate }
   29 
   30 }