mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
abbrevs: fix possible exception and do some cleanup
This commit is contained in:
parent
a06ad1fefd
commit
9978f6bdd7
1 changed files with 1 additions and 2 deletions
|
@ -19,12 +19,11 @@ setattr(builtins, "abbrevs", proxy)
|
||||||
|
|
||||||
|
|
||||||
def expand_abbrev(buffer):
|
def expand_abbrev(buffer):
|
||||||
abbrevs = getattr(builtins, "abbrevs")
|
abbrevs = getattr(builtins, "abbrevs", None)
|
||||||
if abbrevs is None:
|
if abbrevs is None:
|
||||||
return
|
return
|
||||||
document = buffer.document
|
document = buffer.document
|
||||||
word = document.get_word_before_cursor()
|
word = document.get_word_before_cursor()
|
||||||
abbrevs = builtins.abbrevs
|
|
||||||
if word in abbrevs.keys():
|
if word in abbrevs.keys():
|
||||||
partial = document.text[: document.cursor_position]
|
partial = document.text[: document.cursor_position]
|
||||||
startix, endix, quote = check_for_partial_string(partial)
|
startix, endix, quote = check_for_partial_string(partial)
|
||||||
|
|
Loading…
Add table
Reference in a new issue