Commit 8e4b7583f6248925729c697e6f92f9f83ee66080

Thomas de Grivel 2022-01-18T11:55:55

fix line numbers +1

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/kmxgit_web/controllers/repository_controller.ex b/lib/kmxgit_web/controllers/repository_controller.ex
index 7d8be24..9e3e3fa 100644
--- a/lib/kmxgit_web/controllers/repository_controller.ex
+++ b/lib/kmxgit_web/controllers/repository_controller.ex
@@ -453,6 +453,7 @@ defmodule KmxgitWeb.RepositoryController do
   def line_numbers(string) do
     string
     |> String.split("\n")
+    |> tl()
     |> Enum.with_index()
     |> Enum.map(fn {_, i} -> "#{i + 1}" end)
   end