File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ local git = require("neogit.lib.git")
22local Path = require (" plenary.path" )
33local util = require (" neogit.lib.util" )
44
5+ local LINE_ENDING = (vim .fn .has (" win32" ) == 1 or vim .fn .has (" win64" ) == 1 ) and " \r\n " or " \n "
6+
57--- @class NeogitGitIndex
68local M = {}
79
@@ -64,9 +66,9 @@ function M.generate_patch(hunk, opts)
6466
6567 table.insert (diff_content , 1 , string.format (" +++ b/%s" , path ))
6668 table.insert (diff_content , 1 , string.format (" --- a/%s" , path ))
67- table.insert (diff_content , " \n " )
69+ table.insert (diff_content , LINE_ENDING )
6870
69- return table.concat (diff_content , " \n " )
71+ return table.concat (diff_content , LINE_ENDING )
7072end
7173
7274--- @param patch string diff generated with M.generate_patch
You can’t perform that action at this time.
0 commit comments