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

Exclude file ext from initial selection when renaming a file.#7209

Merged
zaggino merged 1 commit intoadobe:masterfrom
Robo210:initial_selection
Mar 18, 2014
Merged

Exclude file ext from initial selection when renaming a file.#7209
zaggino merged 1 commit intoadobe:masterfrom
Robo210:initial_selection

Conversation

@Robo210
Copy link
Copy Markdown

@Robo210 Robo210 commented Mar 16, 2014

This change performs the rename as usual through JSTree, then
grabs the DOM node and adjusts the selection on it after the fact.
This fixes issue #7019

This change performs the rename as usual through JSTree, then
grabs the DOM node and adjusts the selection on it after the fact.
This fixes issue #7019
@zaggino
Copy link
Copy Markdown
Contributor

zaggino commented Mar 17, 2014

Initial review done, works & looks fine.

@ingorichter
Copy link
Copy Markdown
Contributor

@zaggino could you please finish this review and when you are done please merge. Thanks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be first index of "." instead? If I have e.g. "foo.css.erb" I'd just want to rename the "foo" part.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When renaming files like less-1.4.2.min.js, usually only the last part is considered an extension.

@zaggino
Copy link
Copy Markdown
Contributor

zaggino commented Mar 18, 2014

Ignore comment, good to merge. My blind self.

zaggino added a commit that referenced this pull request Mar 18, 2014
Exclude file ext from initial selection when renaming a file.
@zaggino zaggino merged commit 8670907 into adobe:master Mar 18, 2014
@zaggino
Copy link
Copy Markdown
Contributor

zaggino commented Mar 18, 2014

@peterflynn - this could be done as a separate PR because it's a bit more complicated. Should we search the languages.json for known extensions that have . in them and use this for selecting?

@peterflynn
Copy link
Copy Markdown
Member

Seems plausible, but I don't know if we have to get that fancy. Your argument above sounded reasonable enough to me -- let's wait & see if we get any feedback about it?

@Denisov21
Copy link
Copy Markdown
Contributor

Hi,
I think it works well now. I share the opinion on "foo.css.erb" is only the extension *.erb. Thanks for the work guys!

@zaggino
Copy link
Copy Markdown
Contributor

zaggino commented Mar 18, 2014

I don't know - I realized I like the fancy idea and also implementation was just a few lines so I made up a PR and I'll leave to others to merge or not to merge :)

@zaggino
Copy link
Copy Markdown
Contributor

zaggino commented Mar 18, 2014

Btw @peterflynn we do not longer use doublequotes " for strings?
I don't see any "quotmark": "double" in https://github.com/adobe/brackets/blob/master/.jshintrc but I remember I was told to do that before.

@peterflynn
Copy link
Copy Markdown
Member

@zaggino Ah, yes -- all JS code should use double-quoted strings (per style guide). So the string in the lastIndexOf() call here should be fixed. Could you roll that into your PR?

@zaggino
Copy link
Copy Markdown
Contributor

zaggino commented Mar 18, 2014

Already did that for PR. Also tried using "quotmark": "double" in JSHint and it blew out a lof of ' usage, especially in test/ but also 20 or so in src/

@peterflynn
Copy link
Copy Markdown
Member

Seems worth fixing the ones in src at least, though not high priority...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants