mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
Let PTK handle continuation characters on Win
This commit is contained in:
parent
a573e7607c
commit
7fc857a56d
1 changed files with 2 additions and 4 deletions
|
@ -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:]))):
|
||||||
|
|
Loading…
Add table
Reference in a new issue