Skip to content
Browse files

Minor fixes for continued completion

  • Loading branch information...
1 parent 1d81a15 commit abb3c03fd9d266a8e1b3ee0b391f0ba04be629e2 @skuroda committed Dec 12, 2012
Showing with 8 additions and 18 deletions.
  1. +8 −3 AdvancedNewFile.py
  2. +0 −15 Default (Windows).sublime-keymap
View
11 AdvancedNewFile.py
@@ -332,7 +332,7 @@ def on_query_completions(self, view, prefix, locations):
print pac.prev_suggestions
if len(pac.prev_suggestions) > 1:
return (pac.prev_suggestions, sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)
- else:
+ elif len(pac.prev_suggestions) == 1:
auto_complete_prefix = pac.prev_suggestions[0][1]
suggestions = []
@@ -415,8 +415,13 @@ def generate_relative_auto_complete(self, path, base, auto_complete_prefix):
# Attempt to prevent searching the same path when a path has been specified
# Problems occur when using tab to complete entry with single completion
# followed by ctrl + space
- if not path.endswith(auto_complete_prefix[0:-1]):
- path = os.path.join(path, auto_complete_prefix)
+ if ":" in auto_complete_prefix:
+ compare_prefix = auto_complete_prefix.split(":", 1)[1]
+ else:
+ compare_prefix = auto_complete_prefix
+
+ if re.search(r"[/\\]$", auto_complete_prefix) and not path.endswith(compare_prefix[0:-1]):
+ path = os.path.join(path, compare_prefix)
for filename in os.listdir(path):
if PathAutocomplete.show_files or os.path.isdir(os.path.join(path, filename)):
View
15 Default (Windows).sublime-keymap
@@ -13,19 +13,4 @@
{ "key": "auto_complete_visible" , "operator": "equal", "operand": false}
]
}
-// ,
-// { "keys": ["tab"], "command": "replace_completion_with_next_completion", "context":
-// [
-// { "key": "advanced_new_file_completion"},
-// { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
-// { "key": "setting.tab_completion", "operator": "equal", "operand": true }
-// ]
-// },
-// { "keys": ["tab"], "command": "commit_completion", "context":
-// [
-// { "key": "advanced_new_file_completion"},
-// { "key": "auto_complete_visible" },
-// { "key": "setting.auto_complete_commit_on_tab" }
-// ]
-// }
]

0 comments on commit abb3c03

Please sign in to comment.
Something went wrong with that request. Please try again.