Skip to content

Commit

Permalink
Do not show autocomplete popup for every string when afn_use_keybindi…
Browse files Browse the repository at this point in the history
…ng is true

When using 'afn_use_keybinding' = true option the autocomplete popup still is opened inside any string and it is quite distracting. I have tried to fix this, though I am not sure if it  is okay to query settings value on every modification.
  • Loading branch information
codedokode authored and jsilvermist committed Jan 10, 2017
1 parent fbbf961 commit 74a5003
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions autofilename.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ def on_modified(self, view):
def on_selection_modified_async(self,view):
if not view.window():
return

# Do not open autocomplete automatically if keybinding mode is used
if not FileNameComplete.is_active and self.get_setting('afn_use_keybinding', view):
return

sel = view.sel()[0]
if sel.empty() and self.at_path_end(view):
scope_contents = view.substr(view.extract_scope(sel.a-1))
Expand Down

1 comment on commit 74a5003

@evandrocoan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this seems to fix this liamcain#106

Please sign in to comment.