Skip to content

Commit f5bfc98

Browse files
author
steveluc
committed
Fixed bug in node startup on Mac. Added typescript_auto_indent setting.
1 parent 32042ae commit f5bfc98

6 files changed

+17
-9
lines changed

Default.sublime-keymap

+5-2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"args": { "key": "}" },
9595
"context": [
9696
{ "key": "selector", "operator": "equal", "operand": "source.ts" },
97+
{ "key": "setting.typescript_auto_format", "operator": "equal", "operand": true },
9798
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
9899
{ "key": "num_selections", "operator": "equal", "operand": 1},
99100
{ "key": "selection_empty", "operator": "equal", "operand": true },
@@ -109,6 +110,7 @@
109110
"args": { "key": "}" },
110111
"context": [
111112
{ "key": "num_selections", "operator": "equal", "operand": 1},
113+
{ "key": "setting.typescript_auto_format", "operator": "equal", "operand": true },
112114
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
113115
{ "key": "selector", "operator": "equal", "operand": "source.ts" },
114116
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
@@ -120,6 +122,7 @@
120122
"args": { "key": ";" },
121123
"context": [
122124
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
125+
{ "key": "setting.typescript_auto_format", "operator": "equal", "operand": true },
123126
{ "key": "selector", "operator": "equal", "operand": "source.ts" }
124127
]
125128
},
@@ -128,7 +131,7 @@
128131
"command": "typescript_format_on_key",
129132
"args": { "key": "\n" },
130133
"context": [
131-
{ "key": "setting.typescript_auto_format", "operator": "equal", "operand": true },
134+
{ "key": "setting.typescript_auto_indent", "operator": "equal", "operand": true },
132135
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
133136
{ "key": "selector", "operator": "not_equal", "operand": "meta.scope.between-tag-pair" },
134137
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
@@ -154,7 +157,7 @@
154157
"keys": [ "enter" ],
155158
"command": "typescript_auto_indent_on_enter_between_curly_brackets",
156159
"context": [
157-
{ "key": "setting.typescript_auto_format", "operator": "equal", "operand": true },
160+
{ "key": "setting.typescript_auto_indent", "operator": "equal", "operand": true },
158161
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
159162
{ "key": "selection_empty", "operator": "equal", "operand": true },
160163
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$" },

Preferences.sublime-settings

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"typescript_auto_format": true,
3+
"auto_complete_commit_on_tab": true
4+
}

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@ Tips
9090
5. By default, the plug-in retains the Sublime native behavior for
9191
auto indent (such as when typing the Enter key). To have the
9292
TypeScript server supply auto indent, set the
93-
'typescript\_auto\_format' setting to true in your
93+
'typescript\_auto\_indent' setting to true in your
9494
Preferences.sublime-settings file. The plug-in does by default
9595
request TypeScript formatting upon typing ';' or '}'. You can turn
96-
off TypeScript formatting on these characters by removing the key
97-
bindings from the Default.sublime-keymap file in the TypeScript
98-
package.
96+
off TypeScript formatting on these characters by setting
97+
'typescript\_auto\_format' to false. The size of the indentation
98+
is controlled by the 'indent\_size' setting. If this setting is
99+
not present, then indentation size will be set to 'tab\_size'.
99100
6. You can get TypeScript formatting for a line by typing 'ctrl+;'.
100101
You can get TypeScript formatting for a document by typing 'ctrl+t,
101102
ctrl+f'. If a selection is present that same key sequence will

TypeScript.py

+1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ def setFilePrefs(view):
379379
settings.set('use_tab_stops', False)
380380
settings.set('translate_tabs_to_spaces', True)
381381
settings.add_on_change('tab_size',lambda: tab_size_changed(view))
382+
settings.add_on_change('indent_size',lambda: tab_size_changed(view))
382383

383384
# given a list of regions and a (possibly zero-length) string to insert,
384385
# send the appropriate change information to the server

TypeScript.sublime-settings

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"auto_complete_triggers" : [ {"selector": "source.ts", "characters": "."} ],
33
"translate_tabs_to_spaces" : true,
4-
"use_tab_stops": false,
5-
"auto_complete_commit_on_tab": true
4+
"use_tab_stops": false
65
}

libs/nodeclient.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def is_executable(fpath):
200200
else:
201201
# /usr/local/bin is not on mac default path
202202
# but is where node is typically installed on mac
203-
path_list = os.environ["PATH"] + os.pathsep + os.path.join("usr","local","bin")
203+
path_list = os.environ["PATH"] + os.pathsep + "/usr/local/bin"
204204
for path in path_list.split(os.pathsep):
205205
path = path.strip('"')
206206
programPath = os.path.join(path, program)

0 commit comments

Comments
 (0)