-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual cursor jumps to end of completion while real position stays put #28
Comments
The The overlay thing is super easy to conflict with other plugins. I gave up the old approach ( Now the newer method seems not a perfect solution. Can you try to reproduce it with a minimal setup? So I can try to fix the compatibility issue. If I fail to fix it, I will provide an option to for these two approaches. |
Sure thing, I'll narrow it down to a minimal setup this weekend :) |
That didn't take long to find. First thing I tried was disabling |
…ent issue When whitespace-mode is enabled, single-line copilot completions makes the cursor look like it's at the end of the completion rather than in it's real position. Issue with gifs showing the behavior is here: copilot-emacs/copilot.el#28 For the most part I should be able to live without whitespace-mode in day to day use, and improvements to the highlight-indent-guides setup should help. And worst case, whitespace-mode can always be toggled easily enough.
I guess removing |
Removing Not sure if you'd consider that a solution or a workaround though, so I'll let you choose if you want to close this issue or not. Thanks again for your help, and continued support for copilot.el :) |
I decided to leave it unsolved for now. Figuring out the logic behind overlay and cursor is a pain for me. The overlay part now is essentially the same as https://github.com/auto-complete/auto-complete/blob/master/auto-complete.el#L927, and I assume it is good enough for general use cases. |
I'm also having this issue, particularly when the completion involves a newline. I am not using whitespace-mode, and in fact I can reproduce it with a minimal configuration only enabling copilot-mode in Here's a minimal reproducer: ;; test.el
(package-initialize)
;; straight.el initialization
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
;; Location of my use-package git clone
(add-to-list 'load-path "~/Documents/use-package")
(require 'use-package)
(use-package copilot
:straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "*.el"))
:ensure t)
(add-hook 'prog-mode-hook 'copilot-mode) Then running:
and typing def test(): The completion looks like: Note that it shows the cursor at the end of the completion but it isn't really there. If I start typing more stuff the cursor is still at the |
I also found the issue is still there with whitespace-mode disabled, does anyone have a temp solution for that? |
Correct for indentation after accepting a completion rather than during typing. This is less confusing than being impeded while typing spaces or tabs on a new line while there is completion preview, and behaves more like VSCode. Fixes copilot-emacs#28 and copilot-emacs#200.
Correct for indentation after accepting a completion rather than during typing. This is less confusing than being impeded while typing spaces or tabs on a new line while there is completion preview, and behaves more like VSCode. Fixes #28 and #200. Co-authored-by: Alexis Asseman <[email protected]>
Correct for indentation after accepting a completion rather than during typing. This is less confusing than being impeded while typing spaces or tabs on a new line while there is completion preview, and behaves more like VSCode. Fixes copilot-emacs#28 and copilot-emacs#200. Co-authored-by: Alexis Asseman <[email protected]>
Ever since commit dfa803e I'm afraid I've had issues with the cursor position.
Physically, the position does not change, and any cursor movement/editing actions briefly show the cursor in the correct position again, until a copilot suggestion appears. However it only happens for single-line suggestions from copilot. If it's suggesting multiple lines, the visual cursor position stays in the right place.
Here's a couple of gifs:
On commit 56b7d1b (latest):
On commit 3dcf2a7 with
copilot-overlay-safe
set tonil
:The text was updated successfully, but these errors were encountered: