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