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

[CLOSED] Tabbing on single-line character range should replace characters with tab #3485

Open
core-ai-bot opened this issue Aug 29, 2021 · 7 comments

Comments

@core-ai-bot
Copy link
Member

Issue by lkcampbell
Sunday May 05, 2013 at 21:57 GMT
Originally opened as adobe/brackets#3723


OS: Windows 7

Build: sprint 24 development build 0.24.0-0 (master a9e27717f)

There are lots of ways to repro this problem, but the steps I provide below represent a typical coding scenario I keep finding problematic. The end goal is to line up the indentations on the equal signs in the variable declarations.

Repro steps:

  1. Copy this gist code into Brackets
  2. Select the space between the variable bar and the equal sign.
  3. Hit the Tab key twice.

Observed Behavior:

Two tab characters are inserted at the beginning of the line. Ugly code.

Expected behavior:

The equal signs for variables foobar and bar should have the same indentation level. Pretty code.

Work Around:

Hit the Backspace key once before hitting the Tab key twice. It sounds simple but my muscle memory just can't seem to manage it. I think it is because some of the other editors I have used (e.g. Sublime, PSPad) give the expected behavior outlined above and I am used to it.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Sunday May 05, 2013 at 22:05 GMT


Tagging as starter bug. Per the newsgroup thread, I think the desired behavior is: insert a Tab char if the selection is entirely contains on one line; indent the line (as today) if the selection spans multiple lines.

@core-ai-bot
Copy link
Member Author

Comment by lkcampbell
Sunday May 05, 2013 at 22:13 GMT


Correct, that is the solution.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday May 09, 2013 at 22:17 GMT


Fixed. Closing.@lkcampbell let us know if this is not fixed for you.

@core-ai-bot
Copy link
Member Author

Comment by lkcampbell
Thursday May 09, 2013 at 23:24 GMT


@redmunds it works fine for editor tabbing set to tabs but it doesn't always work when tabbing is set to spaces.

Updated Repro Steps:

  1. Set Editor Tabbing to Spaces 4
  2. Type "foo bar" on a new document.
  3. Highlight the single space between "foo" and "bar", press the Tab key, observe the results.
  4. Undo the results
  5. Highlight the single space between "foo" and "bar", press the backspace key first then press the Tab key, observe the results.

Expected results:
The results for step 3 and step 5 should be the same, there should be one space between the "foo" and "bar".

Observed results:
The result for Step 3 is incorrect, it has four spaces between the "foo" and "bar" instead of one.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday May 09, 2013 at 23:49 GMT


Thanks for testing. Good catch! Re-opening.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Friday May 10, 2013 at 17:53 GMT


Closing again.@lkcampbell Please test again.

@core-ai-bot
Copy link
Member Author

Comment by lkcampbell
Friday May 10, 2013 at 18:29 GMT


@redmunds, yes, tested all the permutations and it appears to be working correctly now, thanks!

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

No branches or pull requests

1 participant