Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Tabbing on single-line character range should replace characters with tab #3723

Closed
lkcampbell opened this issue May 5, 2013 · 7 comments
Closed
Assignees

Comments

@lkcampbell
Copy link
Contributor

OS: Windows 7

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

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.

@peterflynn
Copy link
Member

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.

@lkcampbell
Copy link
Contributor Author

Correct, that is the solution.

@redmunds
Copy link
Contributor

redmunds commented May 9, 2013

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

@redmunds redmunds closed this as completed May 9, 2013
@lkcampbell
Copy link
Contributor Author

@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.

@ghost ghost assigned redmunds May 9, 2013
@redmunds
Copy link
Contributor

redmunds commented May 9, 2013

Thanks for testing. Good catch! Re-opening.

@redmunds
Copy link
Contributor

Closing again. @lkcampbell Please test again.

@lkcampbell
Copy link
Contributor Author

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

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

No branches or pull requests

3 participants