Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

in Quick Edit, if hit tab to accept JS code hint, completion chars are added twice #3709

Closed
vmitnick opened this issue May 3, 2013 · 4 comments · Fixed by #3711
Closed

Comments

@vmitnick
Copy link

vmitnick commented May 3, 2013

  1. edit a JS file
  2. click on some appropriate code and open Quick Edit
  3. in the inline editor, type some JS code, let code hints appear, and hit tab to accept the first hint --- for example, type "fal", and hit tab to accept "false"
  4. in the main editor, open the file you're editing inline
  5. look at what you just typed

Expected: "false"
Result: "falsese" -- the characters that were added by auto-complete were added twice

Sprint 24, Mac and Windows.

@ghost ghost assigned eztierney and njx May 3, 2013
@njx
Copy link
Contributor

njx commented May 3, 2013

@eztierney / @dloverin I know exactly what this is, sadly. When inside an inline editor in a code hint, using editor.document.replaceRange() (which is usually the right thing) doesn't work due to a fragility in the way we do document syncing. In this case, you have to grit your teeth and use editor._codeMirror.replaceRange() instead. See #1688. When we update to use CodeMirror's doc-linking stuff, this problem should go away, but for now we just hack this in the various code hint providers.

I'll put up a pull request with the fix.

@njx
Copy link
Contributor

njx commented May 3, 2013

Should be fixed in master. @vmitnick - not sure if you're pulling from the repo or just running the packaged sprint build--if you are pulling from the repo and can regress this now, that would be great; otherwise I'll verify it for now and you can check it in the next sprint build.

@vmitnick
Copy link
Author

vmitnick commented May 3, 2013

I'm just using the sprint build, so I'll trust you to verify until next sprint.

@jodyzhang
Copy link
Contributor

verified, closed it.
@vmitnick: if you still see the issue in next sprint, please reopen it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants