mirror of
https://github.com/zyedidia/micro
synced 2024-11-05 17:41:24 +00:00
parent
04f281bf1d
commit
3d387732c4
2 changed files with 13 additions and 13 deletions
File diff suppressed because one or more lines are too long
|
@ -64,17 +64,17 @@ Below is an example for including a linter for any filetype using
|
|||
the `misspell` linter which checks for misspelled words in a file.
|
||||
|
||||
```lua
|
||||
local config = import("micro/config")
|
||||
|
||||
config.RegisterCommonOption("misspell", true)
|
||||
|
||||
function init()
|
||||
-- uses the default linter plugin
|
||||
-- matches any filetype
|
||||
linter.makeLinter("misspell", "", "misspell", {"%f"}, "%f:%l:%c: %m", {}, false, true, 0, 0, hasMisspell)
|
||||
end
|
||||
|
||||
function hasMisspell(buf)
|
||||
return buf.Settings["misspell"]
|
||||
linter.makeLinter("misspell", "", "misspell", {"%f"}, "%f:%l:%c: %m", {}, false, true)
|
||||
end
|
||||
```
|
||||
|
||||
Here is an example for a more typical use-case, where the linter will only match one filetype (C in this case):
|
||||
|
||||
```lua
|
||||
function init()
|
||||
linter.makeLinter("gcc", "c", "gcc", {"-fsyntax-only", "-Wall", "-Wextra", "%f"}, "%f:%l:%c:.+: %m")
|
||||
end
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue