Skip to content

Commit

Permalink
Normalize to LF, Add .editorconfig and .gitattributes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpas committed Sep 16, 2016
1 parent 85e4d42 commit 71253ca
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 125 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
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

3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto
*.png binary
*.jpg binary
6 changes: 3 additions & 3 deletions Default (Linux).sublime-keymap
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" },
]
6 changes: 3 additions & 3 deletions Default (OSX).sublime-keymap
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" },
]
7 changes: 4 additions & 3 deletions Default (Windows).sublime-keymap
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" },
]

12 changes: 6 additions & 6 deletions Default.sublime-commands
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"
}
]
172 changes: 86 additions & 86 deletions Main.sublime-menu
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"
}
]
}
]
}
]
}
]
48 changes: 24 additions & 24 deletions open_last_rpt.py
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"})

0 comments on commit 71253ca

Please sign in to comment.