Skip to content

Commit

Permalink
add radian support for R (#212)
Browse files Browse the repository at this point in the history
* add radian support for R

* Remove some typos
  • Loading branch information
milanglacier authored Apr 1, 2022
1 parent c0c1307 commit 82d61a5
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lua/iron/fts/r.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
local r = {}

r.R = {
command = {"R"},
command = { "R" },
}

local extend = require("iron.util.tables").extend

local format = function(open, close, cr)
return function(lines)
if #lines == 1 then
return { lines[1] .. cr }
else
local new = { open .. lines[1] }
for line = 2, #lines do
table.insert(new, lines[line])
end
return extend(new, close)
end
end
end

r.radian = {
command = { "radian" },
format = format("\27[200~", "\27[201~\13", "\13"),
}

return r

0 comments on commit 82d61a5

Please sign in to comment.