def textView(textView,doCommandBySelector:sel)
puts "#{sel.to_s}"
return false if sel.to_s != "insertNewline:"
puts " in doCommandBySelector selector is #{sel}"
@newline = true
enum = @textView.string.lines(seperaotr=$/)
@location = 0
enum.each_with_index do |l,i|
puts "location is #{@location}"
words = l.split
line = Line.new(words[0],words[1])
@lines[i] = line if @lines[i] != line
red = NSColor.redColor
range = NSMakeRange(@location,l.length)
puts "#{range.location}-#{range.length}"
@textView.setTextColor(red,range) if line.rule == nil
@location = @location + l.length
end
false
end