Let PTK handle continuation characters on Win

This commit is contained in:
Morten Enemark Lund 2017-02-25 16:20:48 +01:00
parent a573e7607c
commit 7fc857a56d

View file

@ -8,7 +8,7 @@ from prompt_toolkit.filters import (Condition, IsMultiline, HasSelection,
from prompt_toolkit.keys import Keys from prompt_toolkit.keys import Keys
from xonsh.aliases import xonsh_exit from xonsh.aliases import xonsh_exit
from xonsh.tools import ON_WINDOWS, check_for_partial_string from xonsh.tools import ON_WINDOWS, check_for_partial_string, LINE_CONT_STR
from xonsh.shell import transform_command from xonsh.shell import transform_command
env = builtins.__xonsh_env__ env = builtins.__xonsh_env__
@ -50,9 +50,7 @@ def carriage_return(b, cli, *, autoindent=True):
b.delete_before_cursor(count=len(indent)) b.delete_before_cursor(count=len(indent))
elif (not doc.on_first_line and not current_line_blank): elif (not doc.on_first_line and not current_line_blank):
b.newline(copy_margin=autoindent) b.newline(copy_margin=autoindent)
elif (doc.char_before_cursor == '\\' and elif (doc.current_line.endswith(str(LINE_CONT_STR))):
not (not builtins.__xonsh_env__.get('FORCE_POSIX_PATHS') and
ON_WINDOWS)):
b.newline(copy_margin=autoindent) b.newline(copy_margin=autoindent)
elif (doc.find_next_word_beginning() is not None and elif (doc.find_next_word_beginning() is not None and
(any(not _is_blank(i) for i in doc.lines_from_current[1:]))): (any(not _is_blank(i) for i in doc.lines_from_current[1:]))):