Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

Commit

Permalink
modified action correctly for micro v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hidaruma committed Jul 22, 2017
1 parent f31605c commit 23f0964
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
textlint(https://github.com/textlint/textlint) plugin for micro-editor(https://github.com/zyedidia/micro)

You have to install textlint and textlint-rules to use this plugin. Expected utf-8 encoding in terminal.
And, you have to put utf8.lua(https://github.com/Stepets/utf8.lua) into the dir which passes LUA_PATH.l

## Usage

Expand Down
6 changes: 3 additions & 3 deletions repo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"Tags": ["check"],
"Versions": [
{
"Version": "0.1.0",
"Url": "https://github.com/hidaruma/micro-textlint-plugin/archive/v0.1.0.zip"
"Version": "0.2.0",
"Url": "https://github.com/hidaruma/micro-textlint-plugin/archive/v0.2.0.zip"
"Require": {
"micro: ">=1.0.3"
"micro: ">=1.2.1"
}
}
]
Expand Down
15 changes: 3 additions & 12 deletions textlint.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
VERSION = "0.1.0"
local utf8 = require "utf8"
VERSION = "0.2.0"

if GetOption("textlint") == nil then
AddOption("textlint", true)
Expand Down Expand Up @@ -43,16 +42,8 @@ function onExit(output, errorformat)
-- Trim whitespace
line = line:match("^%s*(.+)%s*$")
if string.find(line, regex) then
local line, column, msgs = string.match(line, regex)
local m = ""
for msg in utf8.gmatch(msgs,"(.)") do
if utf8.find(msg,"%w|-") then
m = m .. msg
else
m = m .. msg .. " "
end
end
CurView():GutterMessage("textlint", tonumber(line), m, 2)
local line, column, msg = string.match(line, regex)
CurView():GutterMessage("textlint", tonumber(line), msg, 2)
end
end
end

0 comments on commit 23f0964

Please sign in to comment.