Skip to content
Snippets Groups Projects
Commit 5cd27b02 authored by ale's avatar ale
Browse files

Remove code left over by previous cleanup

parent 89a04cf6
Branches
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
(inhibit-quit t) (inhibit-quit t)
(curfile (buffer-file-name)) (curfile (buffer-file-name))
(lang (file-name-extension curfile)) (lang (file-name-extension curfile))
(promptfile (concat curfile ".prompt"))
;; extract the entire buffer up to the current position ;; extract the entire buffer up to the current position
(code (save-excursion (code (save-excursion
(beginning-of-buffer) (beginning-of-buffer)
...@@ -91,9 +91,6 @@ Only output the missing parts of the code. \ ...@@ -91,9 +91,6 @@ Only output the missing parts of the code. \
Generate %s code to complete the following snippet:\n```%s\n%s" Generate %s code to complete the following snippet:\n```%s\n%s"
system context lang lang code))) system context lang lang code)))
;; write out the prompt to a temporary file
(write-region prompt nil promptfile 'silent)
;; run ollama streaming stdout into buffer catching ctrl-g ;; run ollama streaming stdout into buffer catching ctrl-g
(with-local-quit (with-local-quit
(copilot--run-ollama prompt)) (copilot--run-ollama prompt))
...@@ -109,10 +106,7 @@ Generate %s code to complete the following snippet:\n```%s\n%s" ...@@ -109,10 +106,7 @@ Generate %s code to complete the following snippet:\n```%s\n%s"
(goto-char spot) (goto-char spot)
(while (re-search-forward "```[a-z]*" end t) (while (re-search-forward "```[a-z]*" end t)
(setq end (- end (length (match-string 0)))) (setq end (- end (length (match-string 0))))
(replace-match "")))) (replace-match ""))))))
;; remove temporary files
(delete-file promptfile)))
;; define `ctrl-c ctrl-k` keybinding for llm code completion ;; define `ctrl-c ctrl-k` keybinding for llm code completion
(defun copilot-c-hook () (defun copilot-c-hook ()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment