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

MoveToEnclosingBracket does not work at end of file without a newline #5080

Open
1 task done
JosephTLyons opened this issue Dec 16, 2022 · 3 comments
Open
1 task done
Labels
bug [core label] editor Feedback for code editing, formatting, editor iterations, etc good first issue Issue suitable for first-time contributors keymap / key binding Feedback for keyboard shortcuts, key mapping, etc

Comments

@JosephTLyons
Copy link
Collaborator

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

In a json file, the end of the file has has a close ]. There is no newline at the end of the file. If I place my cursor at the end of the file and run the command, nothing happens. If I add a newline to the end of the file, then place my cursor after the ], the command works.

Environment

Zed 0.67.2 – /Applications/Zed Preview.app
macOS 13.1
architecture arm64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue

No response

@JosephTLyons JosephTLyons added bug [core label] editor Feedback for code editing, formatting, editor iterations, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc labels Dec 16, 2022
@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@JosephTLyons JosephTLyons added the good first issue Issue suitable for first-time contributors label Jul 27, 2024
@petros
Copy link
Contributor

petros commented Jul 29, 2024

@JosephTLyons is this what you have in mind for a test file?

[
    { "name": "Gift", "age": 37 },
    { "name": "Stone", "age": 51 },
    { "name": "Bryce", "age": 29 }
]

@JosephTLyons
Copy link
Collaborator Author

JosephTLyons commented Jul 29, 2024

@JosephTLyons is this what you have in mind for a test file?

[
    { "name": "Gift", "age": 37 },
    { "name": "Stone", "age": 51 },
    { "name": "Bryce", "age": 29 }
]

Yes, exactly - this reproduces the issue for me, so long as there isn't a newline at the end of the file.

(Apologies for accidentally closing the issue. 😅)

@RPG-Alex
Copy link

RPG-Alex commented Nov 8, 2024

Should this issue still be open? Testing it it seems that Zed is (at least now) adding a new line if you save the file:

before saving:

image

and then after saving:

image

So it seems like it might have been eliminated by virtue of a new line being automatically added on save?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] editor Feedback for code editing, formatting, editor iterations, etc good first issue Issue suitable for first-time contributors keymap / key binding Feedback for keyboard shortcuts, key mapping, etc
Projects
None yet
Development

No branches or pull requests

3 participants