-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Exclude file ext from initial selection when renaming a file. #7209
Conversation
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
Initial review done, works & looks fine. |
@zaggino could you please finish this review and when you are done please merge. Thanks. |
_projectTree.jstree("rename"); | ||
var indexOfExtension = escapedName.lastIndexOf('.'); |
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.
Should it be first index of "." instead? If I have e.g. "foo.css.erb" I'd just want to rename the "foo" part.
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.
When renaming files like less-1.4.2.min.js
, usually only the last part is considered an extension.
Ignore comment, good to merge. My blind self. |
Exclude file ext from initial selection when renaming a file.
@peterflynn - this could be done as a separate PR because it's a bit more complicated. Should we search the |
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? |
Hi, |
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 :) |
Btw @peterflynn we do not longer use doublequotes |
@zaggino Ah, yes -- all JS code should use double-quoted strings (per style guide). So the string in the |
Already did that for PR. Also tried using |
Seems worth fixing the ones in src at least, though not high priority... |
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