summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.gui.html
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-08 19:56:29 +0200
committerhut <hut@lavabit.com>2010-04-08 19:56:29 +0200
commit4537ca72633b0c60e6fd4700adb6b96c0a823c7b (patch)
tree9b632e2ef4fedea854a1e4199073584385d93647 /doc/pydoc/ranger.gui.html
parent21da5a5ffbe325930ef2c01b016ce68c8cff6eca (diff)
downloadranger-4537ca72633b0c60e6fd4700adb6b96c0a823c7b.tar.gz
tc_direction: fixed
maximum=X means that the maximum value is set to X-1.
Works for lists:
d.move(maximum=len(lst))

is this counter intuitive?
Diffstat (limited to 'doc/pydoc/ranger.gui.html')
0 files changed, 0 insertions, 0 deletions
'#n126'>126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
# .tlv file generated by https://github.com/akkartik/teliva
# You may edit it if you are careful; however, you may see cryptic errors if you
# violate Teliva's assumptions.
#
# .tlv files are representations of Teliva programs. Teliva programs consist of
# sequences of definitions. Each definition is a table of key/value pairs. Keys
# and values are both strings.
#
# Lines in .tlv files always follow exactly one of the following forms:
# - comment lines at the top of the file starting with '#' at column 0
# - beginnings of definitions starting with '- ' at column 0, followed by a
#   key/value pair
# - key/value pairs consisting of '  ' at column 0, containing either a
#   spaceless value on the same line, or a multi-line value
# - multiline values indented by more than 2 spaces, starting with a '>'
#
# If these constraints are violated, Teliva may unceremoniously crash. Please
# report bugs at http://akkartik.name/contact
- __teliva_timestamp: original
  norm:
    >function norm()
    >  window:attrset(curses.A_NORMAL)
    >end
- __teliva_timestamp: original
  bold:
    >function bold()
    >  window:attron(curses.A_BOLD)
    >end
- __teliva_timestamp: original
  rv:
    >function rv()
    >  window:attron(curses.A_REVERSE)
    >end
- __teliva_timestamp: original
  color:
    >function color(i)
    >  window:attron(curses.color_pair(i))
    >end
- __teliva_timestamp: original
  abbreviations:
    >clear = curses.clear
    >refresh = curses.refresh
    >getch = curses.getch
    >addch = curses.addch
    >mvaddch = curses.mvaddch
    >pr = curses.addstr
    >mpr = curses.mvaddstr
    >str = tostring
    >num = tonumber
- __teliva_timestamp: original
  str_helpers:
    >-- some string helpers from http://lua-users.org/wiki/StringIndexing
    >
    >-- index characters using []
    >getmetatable('').__index = function(str,i)
    >  if type(i) == 'number' then
    >    return string.sub(str,i,i)
    >  else
    >    return string[i]
    >  end
    >end
    >
    >-- ranges using (), selected bytes using {}
    >getmetatable('').__call = function(str,i,j)
    >  if type(i)~='table' then
    >    return string.sub(str,i,j)
    >  else
    >    local t={}
    >    for k,v in ipairs(i) do
    >      t[k]=string.sub(str,v,v)
    >    end
    >    return table.concat(t)
    >  end
    >end
    >
    >-- iterate over an ordered sequence
    >function q(x)
    >  if type(x) == 'string' then
    >    return x:gmatch('.')
    >  else
    >    return ipairs(x)
    >  end
    >end
    >
    >-- TODO: backport utf-8 support from Lua 5.3
- __teliva_timestamp: original
  prn:
    >-- functional form of 'print'
    >-- use this in map/reduce/filter
    >function prn(...)
    >  print(unpack(arg))
    >  return arg[1]
    >end
- __teliva_timestamp: original
  add:
    >add = table.insert
- __teliva_timestamp: original
  map:
    >-- only for arrays
    >function map(l, f)
    >  result = {}
    >  for _, x in q(l) do
    >    add(result, f(x))
    >  end
    >  return result
    >end
- __teliva_timestamp: original
  reduce:
    >-- only for arrays
    >function reduce(l, f, init)
    >  result = init
    >  for _, x in q(l) do
    >    result = f(result, x)
    >  end
    >  return result
    >end
- __teliva_timestamp: original
  filter:
    >-- only for arrays
    >function filter(l, f)
    >  result = {}
    >  for _, x in q(l) do
    >    if f(x) then
    >      add(result, x)
    >    end
    >  end
    >  return result
    >end
- __teliva_timestamp: original
  find_index:
    >function find_index(arr, x)
    >  for n, y in q(arr) do
    >    if x == y then
    >      return n
    >    end
    >  end
    >end
- __teliva_timestamp: original
  trim:
    >function trim(s)
    >  return s:gsub('^%s*', ''):gsub('%s*$', '')
    >end
- __teliva_timestamp: original
  split:
    >function split(s, d)
    >  result = {}
    >  for match in (s..d):gmatch("(.-)"..d) do
    >    add(result, match);
    >  end
    >  return result
    >end
- __teliva_timestamp: original
  window:
    >window = curses.stdscr()
- __teliva_timestamp: original
  render:
    >function render(window)
    >  clear()
    >  -- draw stuff to screen here
    >  for line in io.lines("input") do
    >    pr(line)
    >    pr("\n")
    >  end
    >  refresh()
    >end
- __teliva_timestamp: original
  menu:
    >menu = {}
- __teliva_timestamp: original
  update:
    >function update(window)
    >  local key = curses.getch()
    >  -- process key here
    >end
- __teliva_timestamp: original
  init_colors:
    >function init_colors()
    >  for i=0,7 do
    >    curses.init_pair(i, i, -1)
    >  end
    >  curses.init_pair(8, 7, 0)
    >  curses.init_pair(9, 7, 1)
    >  curses.init_pair(10, 7, 2)
    >  curses.init_pair(11, 7, 3)
    >  curses.init_pair(12, 7, 4)
    >  curses.init_pair(13, 7, 5)
    >  curses.init_pair(14, 7, 6)
    >  curses.init_pair(15, -1, 15)
    >end
- main:
    >function main()
    >  init_colors()
    >
    >  while true do
    >    render(window)
    >    update(window)
    >  end
    >end
  __teliva_timestamp: original