This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Expand options for preferences lookups #6715
Merged
Merged
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
328f3f9
Adds Scope aliases and named contexts.
dangoor 66b666c
Fix project scope failure.
dangoor ec13aa9
Line drawn here (implementation change to come).
dangoor aa97b5e
Reverting some of the changes
dangoor e3e8b74
Revamped editor option handling to cover #6578
dangoor e4bbf58
Sends notifications for default filename changes.
dangoor 3e76481
Fix JSHint error
dangoor e18ebfb
Project prefs no longer apply to files outside the project.
dangoor 313706e
`PreferencesManager.set` now handles contexts the same way as `get`
dangoor e362eb6
Last bit of cleanup.
dangoor 638f72d
Merge branch 'master' into dangoor/6578-hidden-editor-options
dangoor a23b7fe
Minor cleanup suggested by @busykai
dangoor edcade2
Makes reusable context objects for searching in project scope
dangoor faeede4
Fix bug with scopeOrder lengthening
dangoor cbb64ea
Merge branch 'master' into dangoor/6578-hidden-editor-options
dangoor b544263
Changes based on review comments
dangoor 72cc71d
Fix JSLint error
dangoor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,6 +308,26 @@ define(function (require, exports, module) { | |
|
||
return baseName.substr(idx + 1); | ||
} | ||
|
||
/** | ||
* Computes filename as relative to the basePath. For example: | ||
* basePath: /foo/bar/, filename: /foo/bar/baz.txt | ||
* returns: baz.txt | ||
* | ||
* The net effect is that the common prefix is stripped away. If basePath is not | ||
* a prefix of filename, then undefined is returned. | ||
* | ||
* @param {string} basePath Path against which we're computing the relative path | ||
* @param {string} filename Full path to the file for which we are computing a relative path | ||
* @return {string} relative path | ||
*/ | ||
function getRelativeFilename(basePath, filename) { | ||
if (!filename || filename.substr(0, basePath.length) !== basePath) { | ||
return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The difference with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The big difference is that this one is just a general utility function that is not tied to projects. It's a bit surprising that we didn't have this kind of function in FileUtils already,. |
||
} | ||
|
||
return filename.substr(basePath.length); | ||
} | ||
|
||
/** @const - hard-coded for now, but may want to make these preferences */ | ||
var _staticHtmlFileExts = ["htm", "html"], | ||
|
@@ -404,6 +424,7 @@ define(function (require, exports, module) { | |
exports.isServerHtmlFileExt = isServerHtmlFileExt; | ||
exports.getDirectoryPath = getDirectoryPath; | ||
exports.getBaseName = getBaseName; | ||
exports.getRelativeFilename = getRelativeFilename; | ||
exports.getFileExtension = getFileExtension; | ||
exports.compareFilenames = compareFilenames; | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
_toggleLineNumbers()
seems to be an unnecessary name. If it's necessary, then it's misnamed. :)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.
Yeah, that was a copy/pasto :)