Fixed function EvaluateExpr

- Added support for column references in current row when defining
  formulas for individual cells.
This commit is contained in:
Dhruva Sagar
2013-05-21 14:32:02 +05:30
parent 3cea0bbaba
commit e4af7200ff

View File

@@ -960,6 +960,10 @@ function! tablemode#EvaluateExpr(expr, line) abort "{{{2
endif endif
if cell =~# ',' if cell =~# ','
if expr =~# '\$'
let expr = substitute(expr, '\$\(\d\+\)',
\ '\=str2float(s:GetCells(line, row, submatch(1)))', 'g')
endif
call s:SetCell(eval(expr), line, row, colm) call s:SetCell(eval(expr), line, row, colm)
else else
let [row, line] = [1, s:GetFirstRow(line)] let [row, line] = [1, s:GetFirstRow(line)]