Skip to content
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

autocomplete pop-up not shown at original cursor when change occurrence #554

Closed
t9md opened this issue Dec 3, 2016 · 3 comments
Closed

Comments

@t9md
Copy link
Owner

t9md commented Dec 3, 2016

  • keystroke: c o f at cursor is newRanges
  • Expected: autocomplete popup shows at original cursor position
  • Actual: popup shown at last occurrence

last-cursor-placement-of-occurrence

@t9md
Copy link
Owner Author

t9md commented Dec 4, 2016

  • autocomplete-popup is shown only at last-cursor.
  • currently when select occurrence, I use internally editor.setSelectedBufferRanges(ranges) which reset current last-selection.
  • So fix is placing last selection at original cursor position.
  • Following situation should be considered
    • When preset-occurrence marker is used. cursor position is not necessarily ON occurrence. Since user can move cursor after putting preset-occurrence marker

[Feedback-welcome-idea] where to put last selection is determined in following order

Not sure if 2, 3 works well, will evaluate.

  1. On occurrence which intersects original selection head position
  2. On occurrence in forward direction within visible screen range.
  3. On occurrence in backward direction within visible screen range.
  4. On occurrence in forward direction in whole buffer, if it reached EOF, then continue from top of buffer till already searched line(top line of visible screen)

@t9md
Copy link
Owner Author

t9md commented Dec 4, 2016

Done 🎉 this is really important improvement!

Test case

Place cursor on @editor then c o f a b c to transform @editor to @abc within function

Before

  • autocomplete popup was always shown at bottom cursor position
  • escape in normal-mode clear multi-cursors but remaining cursor was always topmost one.

before

After

  • autocomplete popup was shown at original cursor position.
  • escape in normal-mode clear multi-cursors respect original cursor position

after

@t9md t9md closed this as completed in #557 Dec 4, 2016
@trkoch
Copy link

trkoch commented Sep 23, 2018

Welcome enhancement to default behavior! While fiddling with #899 I noticed this workaround (I suspect in lib/occurence-manager.js:188) does not seem to be applied to multiple cursors created with cmd+d, which in turn causes to reset to last cursor instead of first. Perhaps if we could make sure order of cursors is the same for both methods we could obviate the need for #1097 at its root? I noticed cmd+d does not seem to be bound to atom-vim?

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

No branches or pull requests

2 participants