aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2022-07-04 10:58:54 +0200
committerMatěj Cepl <mcepl@cepl.eu>2022-07-04 10:58:54 +0200
commit5dd63f3ffc4244375cecaa2edc58f8f1514f77d4 (patch)
tree0b6aee872815c53df51f38c73d88a55409e6fa6d
parent65ba4c81ebaf419d1a514ad4446c90157a0007b4 (diff)
downloadvis-par-5dd63f3ffc4244375cecaa2edc58f8f1514f77d4.tar.gz
Have to work
-rw-r--r--init.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/init.lua b/init.lua
index 3725520..25486c0 100644
--- a/init.lua
+++ b/init.lua
@@ -135,16 +135,19 @@ vis:operator_new(
local non_spc_idx = line:len() >= beg_spc_len + 1 and beg_spc_len + 1 or 0
print("non_spc_idx = " .. non_spc_idx)
- if non_spc_idx ~= 0 then -- FIXME This is wrong, no two cycles
- if p_arg == 0 then
- p_arg = "p" .. hanging_symbol(line, non_spc_idx)
- end
+ -- FIXME This is wrong, consider multi item list
+ if p_arg == 0 then
+ p_arg = "p" .. hanging_symbol(line, non_spc_idx)
+ end
+
+ if non_spc_idx ~= 0 then
+ print("line = " .. line)
print("segment = " .. dump(segment) .. ", p_arg = " .. p_arg)
table.insert(segment, line)
else -- this is an empty line, so do whole circus FIXME
if next(segment) then
local new_text = run_shell_cmd(par_prg, ex_args .. p_arg,
- table.concat(segment, "\n"))
+ table.concat(segment, "\n"))
segment = {}
p_arg = 0
out = out .. new_text