Class: Redcar::EditView::SetMarginColumnCommand

Inherits:
Redcar::EditTabCommand show all
Defined in:
plugins/edit_view/lib/edit_view/commands/language_settings_commands.rb

Constant Summary

Constants included from Observable

Observable::ASPECTS

Instance Attribute Summary

Attributes inherited from Command

#error

Instance Method Summary (collapse)

Methods inherited from Redcar::EditTabCommand

#doc, #edit_view

Methods inherited from Command

active_changed, #environment, inherited, #inspect, norecord, record?, #run

Methods included from Sensitive

#active?, #sensitivities, #sensitivity_names, #sensitize

Methods included from Observable

#add_listener, #notify_listeners, #remove_listener

Instance Method Details

- (Object) execute



39
40
41
42
43
44
45
46
47
# File 'plugins/edit_view/lib/edit_view/commands/language_settings_commands.rb', line 39

def execute
  response = Application::Dialog.input("Margin Column", "Enter new margin column:", tab.edit_view.margin_column) do |text|
    if text !~ /^\d+$/
      "must be an integer number"
    end
  end
  value = response[:value].to_i
  tab.edit_view.margin_column = [[value, 200].min, 5].max
end