Skip to content

issue with narrowing #173

@ultronozm

Description

@ultronozm

copilot often stops working in narrowed buffers. It also sometimes enters a broken state, occasionally requiring a restart of emacs. Here's a simple (non-artificial) example that disables it:

  1. Put the following in *scratch* or some elisp file:
(defun add (a b)
  (+ a b))
(defun sub (a b)
  (- a b))
; 2+2
(defun mul (a b)
  (* a b))
(defun div (a b)
  (/ a b))
  1. Mark the region containing the sub and mul definitions, and M-x narrow-to-region (so that add and div are now hidden).
  2. Put point after the second 2 and insert "=". copilot fails to suggest any completion. (But if you try the same completion in a buffer containing the same contents as this narrowed buffer, it will consistently suggest the completion "4".)
  3. After M-x widen, the buffer is occasionally in a semi-broken state as far as copilot is concerned -- sometimes completion overlays appear a few lines away from point, sometimes they don't appear at all, sometimes it won't work anywhere until I restart emacs, etc. I haven't been able to make this step repeatable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions