-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
… based on first toggle position fixed adobe#11953
@borax12 Thanks for contributing to brackets. |
Ah , i see, checking it out |
@abose i had to push extra commits due to some code formatting issues . Hope it works now |
unit tests for |
@abose - Rewrote the test cases , The editor command handler Unit Test Cases Pass now |
It looks like you're changing it so that inline comments are always indented. Is that correct? This needs to be a preference because some languages (VBScript, PHP, bash?) require that inline comment delimiter is in the first column. Then you'll need tests for both cases. |
@redmunds yeah it is always indented . I checked the behaviour in ST2 for php and bash scripts - they are also always indented . Does brackets have per language based preferences ? |
🆒 Verified, all unit tests passing now. |
Brackets already has a mechanism for specifying language specific preferences, so no need to invent a new one. Take a look at this example in the How to Use Brackets doc, especially the "language" section: "language": {
"javascript": {
...
}
}, As far as what to call the new preference, it depends on what the default is. Since the current default is not to indent, then a name like Don't forget to add new preference to Preferences section of the How to Use Brackets doc and also to the defaultPreferences.json file. |
If some languages require that the comments start on the first column, it should be a property of the language definition and not a preference. There can be a preference if an user decides to overwrite such behaviour or wants to go back to have comments at the start of a line. |
Never knew that language based pref existed 😅 Thanks @redmunds @TomMalbran |
@borax12 There is already PR #11574 that looks like it fixes the same issue. @marcelgerber What's the status of your PR? |
i will do that @Arun . I have been trying to get the per language On 12/1/15, Arun Bose notifications@github.com wrote:
[image: Supratim Chakraborty on about.me] Supratim Chakraborty |
@borax12 Did you get any chance to look into the isues? This is a very good usability improvement that we could ship as part of 1.6 coming late december or early jan. |
@petetnt - i separated the test cases with one set making it run with preference set to true and other making it run on preference set to false |
@petetnt - is there anything else needed on this , just needed an update :) |
Sorry @borax12, I have been swamped with work so I haven't had the time to review the latest commit. I'll do it tomorrow morning if that is okay with you 👍 |
no worries there @petetnt - appreciate the update .And regarding the work . I hope it turns out the best for you :) |
@petetnt - updates? :) |
beforeEach(setupFullEditor); | ||
describe("Line comment/uncomment with indentLineComment enabled", function () { | ||
|
||
beforeEach(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: Indentation with the beforeEach
and afterEach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petetnt -what exactly needs to be indented here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about being vague: I mean that there's extra indentation within this function block:
beforeEach(function () {
setupFullEditor();
PreferencesManager.set("indentLineComment",true);
});
Should be:
beforeEach(function () {
setupFullEditor();
PreferencesManager.set("indentLineComment",true);
});
@borax12 Sorry for taking so long 🐌 I made some more comments, mostly just style nitpicks but there was a single test that wasn't changed to split format later in the file too. |
@petetnt - i made the final changes , split the two tests and tried to address the top mentioned style nits , hopefully this should do it :) |
…commentindent feature- that was a tough one month
@petetnt - hey man , i must be bugging you , but i did split the changes, i guess that should do it |
LGTM /cc @abose |
LGTM. Verified all the test cases hilighted. |
cool @abose - looking forward to contributing more :) |
@borax12 If you are interested in contributing to new features in brackets, please take a look at our trello board to see features requested by the community. |
Better line comment toggling , initiates the line comment at the start of the code and maintains the position of the cursor throughout (like sublime )
Better for lint to comment indents
Affected me so hence changed it
Will fail some editorCommandHandler tests which expect the line comment at the start of the line
fix for #11953 (comment)