Skip to content
This repository has been archived by the owner on Jan 21, 2018. It is now read-only.

Commit

Permalink
Revert 168125f. Add 'open files only' cmd #22
Browse files Browse the repository at this point in the history
  • Loading branch information
robcowie committed Apr 8, 2012
1 parent 168125f commit 0b3c293
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
6 changes: 5 additions & 1 deletion Default.sublime-commands
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[
{
"caption": "Show TODOs in project and open files",
"caption": "Show TODOs: Project and open files",
"command": "todo"
},
{
"caption": "Show TODOs: Open files only",
"command": "todo", "args": {"open_files_only": true}
}
]
14 changes: 3 additions & 11 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,11 @@ Override the results view title by setting `result_title`
"result_title": "TODO Results"
```

## Scanning open files only

If you have a particularly large project (>2k files), you may want to scan only open (saved) files.

```javascript
"open_files_only": true
```


# Usage

`Show TODOs` command can be triggered from the command palette. No default
key bindings are provided.
`Show TODOs: Project and open files` scans all files in your project
`Show TODOs: Open files only` scans only open, saved files
Both are triggered from the command palette. No default key bindings are provided.

## Navigating results

Expand Down
5 changes: 2 additions & 3 deletions todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,13 @@ def search_paths(self, window, open_files_only=False):
window.folders() if not open_files_only else []
)

def run(self, edit):
def run(self, edit, open_files_only=False):
window = self.view.window()
settings = Settings(self.view.settings().get('todo', {}))


## TODO: Cleanup this init code. Maybe move it to the settings object
filepaths, dirpaths = self.search_paths(window,
open_files_only=settings.get('open_files_only', False))
filepaths, dirpaths = self.search_paths(window, open_files_only=open_files_only)

ignored_dirs = settings.get('folder_exclude_patterns', [])
## Get exclude patterns from global settings
Expand Down

0 comments on commit 0b3c293

Please sign in to comment.