class NvimConf::Commenter

Public Class Methods

comment_block(configuration, section, spacer: false) click to toggle source
# File lib/nvim_conf/commenter.rb, line 4
      def comment_block(configuration, section, spacer: false)
        return if skip?(configuration)

        padded_title = section.center(20)
        border = "#" * (padded_title.length + 4)

        <<~FORMAT
          #{spacer ? "\n\n" : ""}
          -- #{border}
          -- # #{padded_title} #
          -- #{border}
        FORMAT
      end
skip?(configuration) click to toggle source
# File lib/nvim_conf/commenter.rb, line 18
def skip?(configuration)
  configuration[:format] != :lua || !configuration[:commented]
end