Skip to content

Commit

Permalink
Merge pull request #104 from rsteube/xonsh-fix-import
Browse files Browse the repository at this point in the history
xonsh: fix import for lazy script
  • Loading branch information
rsteube authored Oct 26, 2020
2 parents 00f32eb + 7d31e83 commit 73fe8b0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xonsh/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ import (

func snippetLazy(cmd *cobra.Command) string {
functionName := strings.Replace(cmd.Name(), "-", "__", -1)
return fmt.Sprintf(`import xonsh
return fmt.Sprintf(`from shlex import split
import re
import pathlib
import subprocess
import xonsh
import builtins
from xonsh.completers._aliases import _add_one_completer
from xonsh.completers.path import complete_dir, complete_path
from xonsh.completers.tools import RichCompletion
def _%v_completer(prefix, line, begidx, endidx, ctx):
"""lazy carapace completer for %v"""
if not line.startswith('%v '):
Expand Down

0 comments on commit 73fe8b0

Please sign in to comment.