diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-08-26 16:05:29 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-08-26 16:05:29 +0200 |
| commit | aed935dc991874acce1571edd070902f435bd82a (patch) | |
| tree | 2eb81e03f21ab5f7f6ab88c2d36b41698ad6fe9b | |
| parent | bf63501ac14207e687b85eba2aa585fc103111f7 (diff) | |
| download | vis-spellcheck-aed935dc991874acce1571edd070902f435bd82a.tar.gz vis-spellcheck-aed935dc991874acce1571edd070902f435bd82a.zip | |
wrap io.open or io.proc calls in assert
| -rw-r--r-- | spellcheck.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spellcheck.lua b/spellcheck.lua index fe6c976..e9e3839 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -53,7 +53,7 @@ local function get_typos(range_or_text) return nil end - local tmp_file = io.open(tmp_name, "r") + local tmp_file = assert(io.open(tmp_name, "r")) typos = tmp_file:read("*a") tmp_file:close() os.remove(tmp_name) @@ -304,7 +304,7 @@ vis:map(vis.modes.NORMAL, "<C-w>w", function(keys) -- select a correction local cmd = 'printf "' .. suggestions:gsub(", ", "\\n") .. '\\n" | vis-menu' - local f = io.popen(cmd) + local f = assert(io.popen(cmd)) local correction = f:read("*all") f:close() -- trim correction |
