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

feat(input): add 'code unindent on backspace' for code languages (@notTamion) #5991

Merged
merged 5 commits into from
Nov 15, 2024

Conversation

notTamion
Copy link
Contributor

When using a code language that has tab characters as indentation and you backspace into the indentation, the entire indentation will now be deleted and you will be set back to the end of the previous line. This is how all Jetbrains ides and also a lot of other ides do it. We could add a config option for this if someone wants one (i wasn't really able to come up with a good name for one).

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Oct 28, 2024
Copy link
Contributor

github-actions bot commented Nov 4, 2024

This PR is stale. Please trigger a re-run of the PR check action.

@github-actions github-actions bot added the Stale Has not been updated in a while label Nov 4, 2024
@Miodec
Copy link
Member

Miodec commented Nov 6, 2024

Not sure i like this change, I've never used a code editor that does what you described.

@notTamion
Copy link
Contributor Author

Hmm i mostly use Jetbrains Ides (i assume you use vsc then?) I can add a setting to change this then

@monkeytypegeorge monkeytypegeorge added the packages Changes in local packages label Nov 6, 2024
@github-actions github-actions bot removed the Stale Has not been updated in a while label Nov 6, 2024
@Miodec
Copy link
Member

Miodec commented Nov 8, 2024

I would change the setting to "code unindent on backspace" and have the settings be on or off (so, a boolean). The setting description could also use some work so that its easier to understand. The default value should be off.

@Miodec Miodec added the waiting for update Pull requests or issues that require changes/comments before continuing label Nov 8, 2024
@github-actions github-actions bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Nov 8, 2024
@Miodec
Copy link
Member

Miodec commented Nov 14, 2024

Doesnt work in this case, the tab character is deleted but input doesn't go back to the previous line, caret doesn't move.

image

@Miodec Miodec added the waiting for update Pull requests or issues that require changes/comments before continuing label Nov 14, 2024
@github-actions github-actions bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Nov 14, 2024
@notTamion
Copy link
Contributor Author

fixed

@Miodec
Copy link
Member

Miodec commented Nov 14, 2024

Now I can't get it to trigger at all, with freedom or without, with correct previous line or with an error. Am i doing something wrong?

@notTamion
Copy link
Contributor Author

Do you have a code language selected?

@Miodec
Copy link
Member

Miodec commented Nov 14, 2024

Oh yeah, my bad, seems to be working correctly.

@notTamion
Copy link
Contributor Author

Woops. just noticed i didn‘t pull your changes to the message. could you push that commit again or tell me what the new message was so i can change it

@Miodec
Copy link
Member

Miodec commented Nov 15, 2024

Thats why you generally wanna avoid force pushing ;)

@Miodec Miodec changed the title impr: backspace into last line for code languages (@notTamion) feat(input): add 'code unindent on backspace' for code languages (@notTamion) Nov 15, 2024
@Miodec Miodec merged commit dea95a2 into monkeytypegame:master Nov 15, 2024
14 checks passed
@Miodec
Copy link
Member

Miodec commented Nov 15, 2024

Thanks

@notTamion
Copy link
Contributor Author

Thats why you generally wanna avoid force pushing ;)

yeah i usually prefer rebasing over merging but i sometimes forget to pull the feature branch

@notTamion notTamion deleted the code-tab-backspace branch November 15, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend User interface or web stuff packages Changes in local packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants