-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from desdic/20231109modifiable
Made buffer for output readonly
- Loading branch information
Showing
19 changed files
with
316 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
column_width = 80 | ||
line_endings = "Unix" | ||
indent_type = "Spaces" | ||
indent_width = 4 | ||
quote_style = "AutoPreferDouble" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
local utils = require("greyjoy.utils") | ||
local ok, greyjoy = pcall(require, "greyjoy") | ||
if not ok then | ||
vim.notify( | ||
"This plugin requires greyjoy.nvim (https://github.com/desdic/greyjoy.nvim)", | ||
vim.lsp.log_levels.ERROR, | ||
{ title = "Plugin error" } | ||
) | ||
return | ||
end | ||
|
||
local M = {} | ||
|
||
M.readfile = function(filename) | ||
if not utils.file_exists(filename) then | ||
return nil | ||
end | ||
local content = vim.fn.readfile(filename) | ||
local obj = vim.fn.json_decode(content) | ||
return obj | ||
end | ||
|
||
M.parse = function(fileobj) | ||
local globalcommands = {} | ||
-- Reuse the greyjoy patterns to find root of project | ||
local rootdir = | ||
vim.fs.dirname(vim.fs.find(greyjoy.patterns, { upward = true })[1]) | ||
local filename = rootdir .. "/greyjoy.json" | ||
|
||
local obj = M.readfile(filename) | ||
if obj then | ||
for key, value in pairs(obj) do | ||
print(vim.inspect(key, value)) | ||
end | ||
end | ||
|
||
return globalcommands | ||
end | ||
|
||
return greyjoy.register_extension({ | ||
setup = function(config) | ||
M.config = config | ||
end, | ||
exports = { | ||
type = "global", | ||
parse = M.parse, | ||
}, | ||
}) |
Oops, something went wrong.