Repository navigation
Fix copy/pasting files under certain scenarios - #649
Conversation
There was a problem hiding this comment.
I initially tried to use an extended regex pattern here (the /// provided by Coffeescript), but that led to some nasty escaping issues with #{path.sep} because apparently interpolation happens before the regex is parsed.
|
+1, came here to report the issue when copying/pasting files with dots in their absolute path. |
|
Hmm, that reminds me that I still need to add specs to this. |
|
+1. This also happens for me when trying to copy the file ~/.teamocil/sj.yml Instead of getting ~/.teamocil/sj.0.yml I get another folder and a file without extension: ~/0.teamocil/sj This on 1.3.3. Pretty please, can this be fixed into master? |
I still need to fix the specs. |
|
Deleted the wrong branch by accident... 😟 |
|
The remaining specs are severely stumping me, but I'm probably just missing something really obvious. When run normally through the specs window, Anyone have any ideas? |
e.g. test.min.js -> test0.min.js, not test.min0.js
A while being 6 months 😆...😦. The new specs now pass on my machine - just waiting on Travis to confirm that they're good to go ⌚ ⏳. I also decided to go with #581 and not #397 as the base filename should always be incremented and not any of the extensions. I'm worried about the regex performance though - matching long filenames takes a considerable number of steps (147 for @atom/feedback |
# Conflicts: # lib/tree-view.coffee
|
Thanks, @50Wliu! |
|
Fixes #674 |
This probably should have 2 separate commits, but oh well.
The two issues that have been fixed:
/Users/John.Doe/test.txt), the Tree View would interpret the file to be pasted as/Users/John0.Doe. This would usually fail (for pretty obvious reasons, you're trying to create a new user), especially on Windows.test), the pasted file would betest0.undefinedbecause the extension was undefined, and Tree View didn't care.The fix for 1) involved moving away from
.split()and switching to a similar regex that captures only the last period instead of the first. This naturally led to 2): by adding a check to make sure there are no file separators after the period, the captured regex will always be undefined if the filename doesn't have an extension. Tree View now detects this and acts appropriately.This somewhat addresses #581 in that the last extension will no longer be stripped as per 1). HOWEVER, the second-to-last extension and not the true filename will have the file counter appended to it:style.min.css->style.min0.css. On the other hand, #397 (which I just realized #581 is a duplicate of) is asking for the functionality implemented in this PR. 😕This PR now fixes #581 in the manner requested which I feel is more natural than #397.
Specs might take me a while. I'll see what I can do.
Fixes #464, fixes #648, fixes #581, closes #397