Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme sample code fix mentioned in #9 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,23 @@ local command = require "core.command"
local keymap = require "core.keymap"
local console = require "plugins.console"

command.add(nil, {
command.add("core.docview", {
["project:build-project"] = function()
core.log "Building..."
local build_command
if string.match(core.active_view.doc.filename, "%.py$") then
build_command = string.format("python %q", core.active_view.doc.abs_filename)
elseif string.match(core.active_view.doc.filename, "%.c$") then
build_command = "./build_c.sh"
elseif string.match(core.active_view.doc.filename, "%.lua$") then
build_command = "./build_lua.sh"
else
return
end
console.run {
command = "./build.sh",
command = build_command,
file_pattern = "(.*):(%d+):(%d+): (.*)$",
cwd = "."
cwd = ".",
on_complete = function(retcode) core.log("Build complete with return code "..retcode) end,
}
end
Expand Down