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

Commit 23f0964

Browse files
committed
modified action correctly for micro v1.2.1
1 parent f31605c commit 23f0964

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
textlint(https://github.com/textlint/textlint) plugin for micro-editor(https://github.com/zyedidia/micro)
33

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

76
## Usage
87

repo.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"Tags": ["check"],
55
"Versions": [
66
{
7-
"Version": "0.1.0",
8-
"Url": "https://github.com/hidaruma/micro-textlint-plugin/archive/v0.1.0.zip"
7+
"Version": "0.2.0",
8+
"Url": "https://github.com/hidaruma/micro-textlint-plugin/archive/v0.2.0.zip"
99
"Require": {
10-
"micro: ">=1.0.3"
10+
"micro: ">=1.2.1"
1111
}
1212
}
1313
]

textlint.lua

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
VERSION = "0.1.0"
2-
local utf8 = require "utf8"
1+
VERSION = "0.2.0"
32

43
if GetOption("textlint") == nil then
54
AddOption("textlint", true)
@@ -43,16 +42,8 @@ function onExit(output, errorformat)
4342
-- Trim whitespace
4443
line = line:match("^%s*(.+)%s*$")
4544
if string.find(line, regex) then
46-
local line, column, msgs = string.match(line, regex)
47-
local m = ""
48-
for msg in utf8.gmatch(msgs,"(.)") do
49-
if utf8.find(msg,"%w|-") then
50-
m = m .. msg
51-
else
52-
m = m .. msg .. " "
53-
end
54-
end
55-
CurView():GutterMessage("textlint", tonumber(line), m, 2)
45+
local line, column, msg = string.match(line, regex)
46+
CurView():GutterMessage("textlint", tonumber(line), msg, 2)
5647
end
5748
end
5849
end

0 commit comments

Comments
 (0)