-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize to LF, Add .editorconfig and .gitattributes
- Loading branch information
Showing
8 changed files
with
142 additions
and
125 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto | ||
*.png binary | ||
*.jpg binary |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[ | ||
{ "keys": ["alt+a+r"], "command": "tail_last_rpt" }, | ||
] | ||
[ | ||
{ "keys": ["alt+a+r"], "command": "open_last_rpt" }, | ||
] |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[ | ||
{ "keys": ["alt+a+r"], "command": "tail_last_rpt" }, | ||
] | ||
[ | ||
{ "keys": ["alt+a+r"], "command": "open_last_rpt" }, | ||
] |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[ | ||
{ "keys": ["alt+a+r"], "command": "tail_last_rpt" }, | ||
] | ||
[ | ||
{ "keys": ["alt+a+r"], "command": "open_last_rpt" }, | ||
] | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[ | ||
{ | ||
"caption": "Open Last RPT", | ||
"command": "open_last_rpt" | ||
} | ||
] | ||
[ | ||
{ | ||
"caption": "Open Last RPT", | ||
"command": "open_last_rpt" | ||
} | ||
] |
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 |
---|---|---|
@@ -1,86 +1,86 @@ | ||
[ | ||
{ | ||
"caption": "Project", | ||
"id": "project", | ||
"children": | ||
[ | ||
{ | ||
"caption": "-" | ||
}, | ||
{ | ||
"caption": "Open Last RPT", | ||
"command": "open_last_rpt" | ||
}, | ||
] | ||
}, | ||
{ | ||
"caption": "Preferences", | ||
"mnemonic": "n", | ||
"id": "preferences", | ||
"children": | ||
[ | ||
{ | ||
"caption": "Package Settings", | ||
"mnemonic": "P", | ||
"id": "package-settings", | ||
"children": | ||
[ | ||
{ | ||
"caption": "Open Last RPT", | ||
"children": | ||
[ | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/OpenLastRPT/Default (OSX).sublime-keymap", | ||
"platform": "OSX" | ||
}, | ||
"caption": "Key Bindings – Default" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/OpenLastRPT/Default (Linux).sublime-keymap", | ||
"platform": "Linux" | ||
}, | ||
"caption": "Key Bindings – Default" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/OpenLastRPT/Default (Windows).sublime-keymap", | ||
"platform": "Windows" | ||
}, | ||
"caption": "Key Bindings – Default" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/User/Default (OSX).sublime-keymap", | ||
"platform": "OSX" | ||
}, | ||
"caption": "Key Bindings – User" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/User/Default (Linux).sublime-keymap", | ||
"platform": "Linux" | ||
}, | ||
"caption": "Key Bindings – User" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/User/Default (Windows).sublime-keymap", | ||
"platform": "Windows" | ||
}, | ||
"caption": "Key Bindings – User" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
[ | ||
{ | ||
"caption": "Project", | ||
"id": "project", | ||
"children": | ||
[ | ||
{ | ||
"caption": "-" | ||
}, | ||
{ | ||
"caption": "Open Last RPT", | ||
"command": "open_last_rpt" | ||
}, | ||
] | ||
}, | ||
{ | ||
"caption": "Preferences", | ||
"mnemonic": "n", | ||
"id": "preferences", | ||
"children": | ||
[ | ||
{ | ||
"caption": "Package Settings", | ||
"mnemonic": "P", | ||
"id": "package-settings", | ||
"children": | ||
[ | ||
{ | ||
"caption": "Open Last RPT", | ||
"children": | ||
[ | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/OpenLastRPT/Default (OSX).sublime-keymap", | ||
"platform": "OSX" | ||
}, | ||
"caption": "Key Bindings – Default" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/OpenLastRPT/Default (Linux).sublime-keymap", | ||
"platform": "Linux" | ||
}, | ||
"caption": "Key Bindings – Default" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/OpenLastRPT/Default (Windows).sublime-keymap", | ||
"platform": "Windows" | ||
}, | ||
"caption": "Key Bindings – Default" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/User/Default (OSX).sublime-keymap", | ||
"platform": "OSX" | ||
}, | ||
"caption": "Key Bindings – User" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/User/Default (Linux).sublime-keymap", | ||
"platform": "Linux" | ||
}, | ||
"caption": "Key Bindings – User" | ||
}, | ||
{ | ||
"command": "open_file", | ||
"args": { | ||
"file": "${packages}/User/Default (Windows).sublime-keymap", | ||
"platform": "Windows" | ||
}, | ||
"caption": "Key Bindings – User" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import os | ||
import glob | ||
import sublime, sublime_plugin | ||
|
||
rpt_files = [] | ||
|
||
class OpenLastRptCommand(sublime_plugin.WindowCommand): | ||
def run(self): | ||
# Get last RPT file | ||
base_folder = os.path.join(os.getenv("LOCALAPPDATA"), "Arma 3") | ||
newest_rpt_file = max(glob.iglob(os.path.join(base_folder, "*.rpt")), key=os.path.getctime) | ||
# Save file into list for EventListener | ||
global rpt_files | ||
rpt_files.append(newest_rpt_file) | ||
# Open file | ||
self.window.open_file(newest_rpt_file) | ||
|
||
class EventListener(sublime_plugin.EventListener): | ||
# Called when a file is finished loading | ||
def on_load_async(self, view): | ||
global rpt_files | ||
if view.file_name() in rpt_files: | ||
rpt_files.remove(view.file_name()) | ||
view.run_command("move_to", {"to": "eof"}) | ||
import os | ||
import glob | ||
import sublime, sublime_plugin | ||
|
||
rpt_files = [] | ||
|
||
class OpenLastRptCommand(sublime_plugin.WindowCommand): | ||
def run(self): | ||
# Get last RPT file | ||
base_folder = os.path.join(os.getenv("LOCALAPPDATA"), "Arma 3") | ||
newest_rpt_file = max(glob.iglob(os.path.join(base_folder, "*.rpt")), key=os.path.getctime) | ||
# Save file into list for EventListener | ||
global rpt_files | ||
rpt_files.append(newest_rpt_file) | ||
# Open file | ||
self.window.open_file(newest_rpt_file) | ||
|
||
class EventListener(sublime_plugin.EventListener): | ||
# Called when a file is finished loading | ||
def on_load_async(self, view): | ||
global rpt_files | ||
if view.file_name() in rpt_files: | ||
rpt_files.remove(view.file_name()) | ||
view.run_command("move_to", {"to": "eof"}) |