Thomas 2 éve
szülő
commit
7c371311f1
1 módosított fájl, 6 hozzáadás és 5 törlés
  1. 6 5
      lua/cspell/code_actions/make_add_to_json.lua

+ 6 - 5
lua/cspell/code_actions/make_add_to_json.lua

@@ -33,18 +33,19 @@ return function(opts)
 
             vim.fn.writefile(lines, cspell.path)
 
-            -- replace word in buffer to trigger cspell to update diagnostics
-            h.set_word(opts.diagnostic, opts.word)
-
             local handle = io.popen("pwd")
             local pwd = handle:read("a*")
             handle:close()
+
             os.execute("cd " .. os.getenv("HOME") .. "/.config/cspell/")
             os.execute("git add .")
-
             os.execute("git commit -m 'word added'")
             os.execute("git push")
-            os.execute("cd "..pwd)
+            os.execute("cd " .. pwd)
+
+            -- replace word in buffer to trigger cspell to update diagnostics
+            h.set_word(opts.diagnostic, opts.word)
+
             if on_success then
                 on_success(cspell.path, opts.params, "add_to_json")
             end