From da170c44b9c0bd04826db4f0ed469a0af04fa342 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Sat, 6 Jun 2020 10:35:59 +0300 Subject: [PATCH] correctly skip first comma in bound function snippets --- src/analysis.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analysis.zig b/src/analysis.zig index 58f2da3..6af54c3 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -89,7 +89,7 @@ pub fn getFunctionSnippet(allocator: *std.mem.Allocator, tree: *ast.Tree, func: for (func.paramsConst()) |param, param_num| { if (skip_self_param and param_num == 0) continue; - if (param_num != 0) try buffer.appendSlice(", ${") else try buffer.appendSlice("${"); + if (param_num != @boolToInt(skip_self_param)) try buffer.appendSlice(", ${") else try buffer.appendSlice("${"); try buf_stream.print("{}:", .{param_num + 1});