+(mod)
click to toggle source
def +(mod)
return chars(mod) if mod.kind_of?(Numeric)
mod = mod.to_s
if mod =~ /^\s*[+-]?\d/
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod)
else
Tk::Text::IndexString.new(String.new(id) << ' ' << mod)
end
end
-(mod)
click to toggle source
def -(mod)
return chars(-mod) if mod.kind_of?(Numeric)
mod = mod.to_s
if mod =~ /^\s*[+-]?\d/
Tk::Text::IndexString.new(String.new(id) << ' - ' << mod)
elsif mod =~ /^\s*[-]\s+(\d.*)$/
Tk::Text::IndexString.new(String.new(id) << ' - -' << $1)
else
Tk::Text::IndexString.new(String.new(id) << ' ' << mod)
end
end
any_char(mod)
click to toggle source
any_chars(mod)
click to toggle source
def any_chars(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any chars')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any chars')
end
end
any_indices(mod)
click to toggle source
def any_indices(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any indices')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any indices')
end
end
any_line(mod)
click to toggle source
any_lines(mod)
click to toggle source
def any_lines(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any_lines')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any lines')
end
end
char(mod)
click to toggle source
chars(mod)
click to toggle source
def chars(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' chars')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' chars')
end
end
display_char(mod)
click to toggle source
display_chars(mod)
click to toggle source
def display_chars(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display chars')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display chars')
end
end
display_indices(mod)
click to toggle source
def display_indices(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display indices')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display indices')
end
end
display_line(mod)
click to toggle source
display_lineend()
click to toggle source
def display_lineend
Tk::Text::IndexString.new(String.new(id) << ' display lineend')
end
display_lines(mod)
click to toggle source
def display_lines(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display_lines')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display lines')
end
end
display_linestart()
click to toggle source
def display_linestart
Tk::Text::IndexString.new(String.new(id) << ' display linestart')
end
display_wordend()
click to toggle source
def display_wordend
Tk::Text::IndexString.new(String.new(id) << ' display wordend')
end
display_wordstart()
click to toggle source
def display_wordstart
Tk::Text::IndexString.new(String.new(id) << ' display wordstart')
end
indices(mod)
click to toggle source
def indices(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' indices')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' indices')
end
end
line(mod)
click to toggle source
lineend()
click to toggle source
def lineend
Tk::Text::IndexString.new(String.new(id) << ' lineend')
end
lines(mod)
click to toggle source
def lines(mod)
fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
if mod < 0
Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' lines')
else
Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' lines')
end
end
linestart()
click to toggle source
def linestart
Tk::Text::IndexString.new(String.new(id) << ' linestart')
end
wordend()
click to toggle source
def wordend
Tk::Text::IndexString.new(String.new(id) << ' wordend')
end
wordstart()
click to toggle source
def wordstart
Tk::Text::IndexString.new(String.new(id) << ' wordstart')
end