mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +02:00
Move IPython prompt and rcsh renderers into a separate module
Some applications that use readline use same variants of telling it where highlighting starts and ends. This module will also be used for pdb.
This commit is contained in:
parent
cddfc364c1
commit
f5d96743fe
@ -15,7 +15,7 @@ fn _powerline_continuation_prompt {
|
||||
_powerline_prompt --renderer-arg 'local_theme=continuation' $*
|
||||
}
|
||||
fn _powerline_prompt {
|
||||
$POWERLINE_COMMAND $POWERLINE_COMMAND_ARGS shell aboveleft -r.rcsh --last-pipe-status $^_POWERLINE_STATUS --last-exit-code $_POWERLINE_STATUS($#_POWERLINE_STATUS) --jobnum $_POWERLINE_JOBNUM --renderer-arg 'client_id='$pid $*
|
||||
$POWERLINE_COMMAND $POWERLINE_COMMAND_ARGS shell aboveleft -r.readline --last-pipe-status $^_POWERLINE_STATUS --last-exit-code $_POWERLINE_STATUS($#_POWERLINE_STATUS) --jobnum $_POWERLINE_JOBNUM --renderer-arg 'client_id='$pid $*
|
||||
}
|
||||
fn _powerline_set_prompt {
|
||||
_POWERLINE_STATUS = ( $status )
|
||||
|
@ -2,6 +2,7 @@
|
||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||
|
||||
from powerline.renderers.shell import ShellRenderer
|
||||
from powerline.renderers.shell.readline import ReadlineRenderer
|
||||
from powerline.theme import Theme
|
||||
|
||||
|
||||
@ -45,10 +46,9 @@ class IPythonRenderer(ShellRenderer):
|
||||
)
|
||||
|
||||
|
||||
class IPythonPromptRenderer(IPythonRenderer):
|
||||
class IPythonPromptRenderer(IPythonRenderer, ReadlineRenderer):
|
||||
'''Powerline ipython prompt (in and in2) renderer'''
|
||||
escape_hl_start = '\x01'
|
||||
escape_hl_end = '\x02'
|
||||
pass
|
||||
|
||||
|
||||
class IPythonNonPromptRenderer(IPythonRenderer):
|
||||
|
@ -1,12 +1,7 @@
|
||||
# vim:fileencoding=utf-8:noet
|
||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||
|
||||
from powerline.renderers.shell import ShellRenderer
|
||||
from powerline.renderers.shell.readline import ReadlineRenderer
|
||||
|
||||
|
||||
class RcshRenderer(ShellRenderer):
|
||||
'''Powerline rcsh prompt renderer'''
|
||||
escape_hl_start = '\x01'
|
||||
escape_hl_end = '\x02'
|
||||
|
||||
renderer = RcshRenderer
|
||||
renderer = ReadlineRenderer
|
||||
|
14
powerline/renderers/shell/readline.py
Normal file
14
powerline/renderers/shell/readline.py
Normal file
@ -0,0 +1,14 @@
|
||||
# vim:fileencoding=utf-8:noet
|
||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||
|
||||
from powerline.renderers.shell import ShellRenderer
|
||||
|
||||
|
||||
class ReadlineRenderer(ShellRenderer):
|
||||
'''Renderer useful for some applications that use readline
|
||||
'''
|
||||
escape_hl_start = '\x01'
|
||||
escape_hl_end = '\x02'
|
||||
|
||||
|
||||
renderer = ReadlineRenderer
|
Loading…
x
Reference in New Issue
Block a user