Skip to content

Commit

Permalink
Fixed windows activation error
Browse files Browse the repository at this point in the history
  • Loading branch information
robarnolddev committed Jan 12, 2018
1 parent f74f946 commit f439f60
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@ out
node_modules
.vscode-test/
.vsix
.DS_Store
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -4,7 +4,11 @@ All notable changes to the "todo-txt" extension will be documented in this file.

todo-txt follows semantic versioning for all releases.

## [Unreleased]
## [0.0.2] - 2018-01-10

### Fixed

Fixed inadvertant issue with extension not activating on windows machines

## [0.0.1] - 2018-01-10

Expand Down
21 changes: 21 additions & 0 deletions LICENSE.md
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2018] [Robert E Arnold]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -11,6 +11,8 @@

Current features are very limited and focus solely on syntax highlighting and completed task formatting for todo.txt formats. See the roadmap for full feature plans.

Please see [todo.txt](http://todotxt.org) for full features and functionality of the todo.txt format.

## Feature Roadmap

Soon:
Expand Down
Binary file added images/todo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions package.json
Expand Up @@ -2,8 +2,9 @@
"name": "todo-txt",
"displayName": "todo-txt",
"description": "Todo.txt file management",
"version": "0.0.1",
"version": "0.0.2",
"publisher": "rarnoldmobile",
"icon": "images/todo.png",
"engines": {
"vscode": "^1.19.0"
},
Expand All @@ -15,8 +16,7 @@
],
"main": "./out/extension",
"contributes": {
"commands": [
]
"commands": []
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand All @@ -30,5 +30,12 @@
"vscode": "^1.1.6",
"@types/node": "^7.0.43",
"@types/mocha": "^2.2.42"
},
"repository": {
"type": "git",
"url": "https://github.com/rarnoldmobile/todo-txt"
},
"dependencies": {
"path": "^0.12.7"
}
}
6 changes: 6 additions & 0 deletions src/AppConstants.ts
@@ -0,0 +1,6 @@
export default class AppConstants {
public static readonly ACCEPTED_FILENAMES = [
'todo.txt',
'done.txt'
]
}
7 changes: 5 additions & 2 deletions src/ToDoDecorator.ts
@@ -1,6 +1,8 @@
import * as vscode from 'vscode';
import { window, Range } from 'vscode';
import StyleConstants from './StyleConstants';
import * as path from 'path';
import AppConstants from './AppConstants';

export default class ToDoDecorator {

Expand Down Expand Up @@ -69,8 +71,9 @@ export default class ToDoDecorator {
if (window.activeTextEditor != undefined) {

// Only Decorate Document if it's in the classic filenaming convention
let fileName = window.activeTextEditor.document.fileName;
if (fileName.endsWith('/todo.txt') || fileName.endsWith('/done.txt')) {
let fileName = path.basename(window.activeTextEditor.document.fileName);

if (AppConstants.ACCEPTED_FILENAMES.lastIndexOf(fileName) >= 0) {
// Iterate over each line and parse accordingl∏
let totalLines = window.activeTextEditor.document.lineCount;
for (var i = 0; i <= totalLines - 1; i++) {
Expand Down

0 comments on commit f439f60

Please sign in to comment.