Pregunta

I am trying to create a build system that will detect a file with a .txt extension then use the program I provided. I know it has something to do with scope, but I can't seem to get it to work.

selector
If the Tools | Build System | Automatic option is set, Sublime Text will automatically find the corresponding build system for the active file by matching selector to the file's scope.

-https://docs.sublimetext.io/guide/usage/build-systems.html

{"cmd": ["cmd", "/k", "python C:\\Users\\Daniel\\Documents\\MyProgramming\\NotesTODO\\notesTODOs.py $file", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "scope.txt",
"shell": "true"}
¿Fue útil?

Solución

Try this:

{
    "cmd": ["cmd", "/k", "python C:\\Users\\Daniel\\Documents\\MyProgramming\\NotesTODO\\notesTODOs.py", "$file"],
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "text.plain",
    "shell": "true"
}

First, you had $file listed twice in your "cmd" line, so I removed one. Second, the scope for plain text is text.plain (there is also text.html, text.tex.latex, etc.). You probably don't need the file_regex, but I don't think it's hurting anything, so that's your call.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top