Sha256: 657eb7cddecaa296d468d37b2537ce9f4d758a933da58fe6615cb5f9f7f7a69b

Contents?: true

Size: 912 Bytes

Versions: 3

Compression:

Stored size: 912 Bytes

Contents

# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
require_relative '../base/subcmd'

class Trepan::Subcommand::SetHighlight < Trepan::SetBoolSubcommand
  unless defined?(HELP)
    Trepanning::Subcommand.set_name_prefix(__FILE__, self)
    HELP       = 'Set whether we use highlight highlighting'
    IN_LIST    = true
    MIN_ABBREV = 'ba'.size
  end
  def run(args)
    if args.size == 3 && 'reset' == args[2]
      LineCache::clear_file_format_cache
    else
      super
      @proc.settings[:highlight] = :term if @proc.settings[:highlight]
    end
  end

end

if __FILE__ == $0
  # Demo it.
  $0 = __FILE__ + 'notagain' # So we don't run this again
  require_relative '../../mock'
  cmd = MockDebugger::sub_setup(Trepan::Subcommand::SetHighlight, false)
  cmd.run(cmd.prefix + ['off'])
  cmd.run(cmd.prefix + ['ofn'])
  cmd.run(cmd.prefix)
  puts cmd.save_command
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trepanning-0.1.2 processor/command/set_subcmd/highlight.rb
trepanning-0.1.1 processor/command/set_subcmd/highlight.rb
trepanning-0.1.0 processor/command/set_subcmd/highlight.rb