Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Conversation

@cabageman2
Copy link

Issue or RFC Endorsed by Atom's Maintainers
Issue #18246 [feature request] Support for jumping to relative line
Description of the Change
Modifies Go to Line feature to allow input of “+20” or “-20,” which moves the cursor up or down the respective number of lines. Does not affect the existing functionality of Go To (input such as “5”, “4:3”), although input is now limited to only valid strings (does not allow “2::3::::5:4” as it used to).
Alternate Designs
Considered continuing to check whether each individual character was valid, as opposed to checking the string as a whole, however this allowed nonsensical input (Go to line/column “2::3::::5:4”). This would also make it more complicated when “+” and “-” were involved as well (didn’t want to allow input such as “:5+23--::”).
Possible Drawbacks
If a user tries to input a string that isn’t valid, the editor simply won’t let the user type invalid characters. This may be a bit confusing because there is no warning message, but should be fairly easy to figure out the cause.
Verification Process
Added test cases to the spec file to demonstrate that the existing go-to-line functionality still works (5:3), as well as the added functionality (+5, -4). Also test cases that ensure that letters and invalid syntax are not able to be typed to avoid bad input.
Release Notes
Allows you to jump to a line in your project relative to your current line, rather than specifying the exact line number.

@winstliu
Copy link
Contributor

Thanks for the submission! Please fix the tests and we'll take another look.

@winstliu winstliu changed the title Issue or RFC Endorsed by Atom's Maintainers Issue #18246 [feature request] Support for jumping to relative line go-to-line: Support for jumping to relative line Apr 17, 2019
@rsese
Copy link
Contributor

rsese commented Apr 23, 2019

Thanks again @cabageman2 🙇

In addition to @50Wliu's comment, we were also wondering if you can talk more about any edge cases you've considered? For example, how does this work if you have multiple cursors?

Also, the other maintainers were hoping for stronger tests around the functionality you're adding? Is that something you can expand on?

cabageman2 and others added 2 commits April 29, 2019 13:07
Updating again hopefully install-application will get merged over 4/29
@cabageman2
Copy link
Author

Sorry, install-application.js was deleted, so we added that back in. Good catch on the functionality tests, we added some tests in spec.js. Also we never knew that the multiple cursor package existed, currently if you use go-to-line when your cursor size is greater than 1, if you go to a higher row it'll change position relative to the cursor's upper limit, if you go to a lower row it'll change position relative to the cursor's lower limit. Also in both cases it'll change the cursor size back to 1.

@rafeca
Copy link
Contributor

rafeca commented May 31, 2019

Hey! 👋

We have recently started using prettier and this has caused major
style changes on the Atom JS codebase (you can check the related PR).

This is good news: now the Atom code is more consistent and it's much easier to re-format the code to
follow the codestyle (now you only need to run script/lint --fix).

This change caused conflicts on your PR that we have automatically solved, hope you don't mind 😄

With ❤️, the Atom team.

@mortenkjaergaard
Copy link

Hi @cabageman2 - just writing to ask if you had any success following up on this? Seems your changes were not approved (I see 'all checks have failed' on the merge request 😥 . I'm super interested in this feature, should you have a chance to address any lingering issues!

@sadick254
Copy link
Contributor

Thank you for your issue!

We haven't gotten a response to our questions in our comment above. I'm going to close this but don't hesitate to reach out if you have resolved the failing tests, we'll be happy to reopen the PR.

@sadick254 sadick254 closed this May 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants