Files
ServerSync/lib/prompt_toolkit/__pycache__/buffer.cpython-314.pyc

623 lines
90 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
9<><39>i#<00> <01><><00>Rt^RIHt^RIt^RIt^RIt^RIt^RIt^RIt^RI t ^RI
t
^RI H t ^RI Ht^RIHt^RIHtHtHtHtHtHt^RIHt^RIHt^R IHtHt^R
IH t ^R I!H"t"^R I#H$t$H%t%H&t&H't'H(t(^R I)H*t*^RI+H,t,^RI-H.t.H/t/^RI0H1t1H2t2^RI3H4t4H5t5^RI6H7t7H8t8H9t9^RI:H;t;H<t<^RI=H>t>H?t?.R-Ot@]P<>!]B4tC!RR]D4tE!RR]4tF!RR4tG]P<>!R4tI!RR4tJ]R.R3,tK]R.]L3,tM!RR4tN]!R ]R!]]]R3,3,R"7tOR#R$ltP!R%R&]D4tQR.R'R(lltRR.R)R*lltSR+R,ltTR#)/zU
Data structures for the Buffer.
It holds the text, cursor position, history, etc...
)<01> annotationsN)<01>deque)<01>Enum)<01>wraps)<06>Any<6E>Callable<6C> Coroutine<6E>Iterable<6C>TypeVar<61>cast)<01>get_app)<01>run_in_terminal)<02> AutoSuggest<73>
Suggestion)<01> FastDictCache)<01> ClipboardData)<05> CompleteEvent<6E> Completer<65>
Completion<EFBFBD>DummyCompleter<65>get_common_complete_suffix)<01>Document)<01>aclosing)<02> FilterOrBool<6F> to_filter)<02>History<72>InMemoryHistory)<02>SearchDirection<6F> SearchState)<03> PasteMode<64>SelectionState<74> SelectionType)<02>Event<6E>to_str)<02>ValidationError<6F> Validator<6F>EditReadOnlyBuffer<65>Buffer<65>CompletionStatec<01><00>]tRt^6tRtRtR#)r&z.Attempt editing of read-only :class:`.Buffer`.<2E>N<><06>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__<5F>__static_attributes__r*<00><00></tmp/pip-target-wqrk2shd/lib/python/prompt_toolkit/buffer.pyr&r&6s<00><00>4r2c<01>&<00>]tRt^:tRtRtRtRtRtR#)<07>ValidationStatezCThe validation state of a buffer. This is set after the validation.<2E>VALID<49>INVALID<49>UNKNOWNr*N) r,r-r.r/r0r6r7r8r1r*r2r3r5r5:s<00><00>I<> <13>E<EFBFBD><17>G<EFBFBD><17>Gr2r5c<01>d<00>]tRt^BtRtRRRlltRRltRRltR R
lt] R R l4t
R t R#)r(z3
Immutable class that contains a completion state.
Nc<01>(<00>V^8<>dQhRRRRRRRR/#) <09><00>original_documentr<00> completionszlist[Completion] | None<6E>complete_index<65>
int | None<6E>return<72>Noner*)<01>formats"r3<00> __annotate__<5F>CompletionState.__annotate__Gs2<00><00>-<2D>-<2D>#<23>-<2D>-<2D>-<2D>#<23> -<2D>
<0E> -r2c <09>@<00>WnT;'g.VnW0nR#<00>N)r<r=r>)<04>selfr<r=r>s&&&&r3<00>__init__<5F>CompletionState.__init__Gs$<00><00>"3<><1E>'<27>,<2C>,<2C>"<22><04><18>-<2D>r2c<01><00>V^8<>dQhRR/#<00>r;r@<00>strr*)rBs"r3rCrDXs<00><00>P<02>P<02>#<23>Pr2c <09><><00>VPP RVP: R\VP4: RVP
: R2#)<04>(z, <z> completions, index=<3D>))<06> __class__r,r<<00>lenr=r><00>rGs&r3<00>__repr__<5F>CompletionState.__repr__Xs_<00><00><16>.<2E>.<2E>)<29>)<29>*<2A>!<21>D<EFBFBD>,B<>,B<>+E<>S<EFBFBD><13>T<EFBFBD>M]<5D>M]<5D>I^<5E>Ha<48>av<61>w{<7B>xK<02>xK<02>wN<02>NO<02>P<02> Pr2c<01> <00>V^8<>dQhRRRR/#<00>r;<00>indexr?r@rAr*)rBs"r3rCrD[s<00><00>(<28>(<28><1A>(<28><04>(r2c <0A><><00>VP'd4Ve(^Tu;8:d\VP48gQhQhWnR#R#)zt
Create a new :class:`.CompletionState` object with the new index.
When `index` is `None` deselect the completion.
N)r=rQr><00>rGrWs&&r3<00> go_to_index<65>CompletionState.go_to_index[sF<00><00> <10> <1B> <1B> <1B><18>=<3D>A<EFBFBD><15>$F<><13>T<EFBFBD>5E<35>5E<35>1F<31>$F<> F<>F<>$F<> F<>F<>"'<27> <1F> r2c<01><00>V^8<>dQhRR/#)r;r@ztuple[str, int]r*)rBs"r3rCrDes<00><00>1<>1<><EFBFBD>1r2c <0A><><00>VPf-VPPVPP3#VPPpVPP
pVP VP,pVP^8XdTpMVRVPpWCP,V,p\V4\VP4,pWV3#)z=
Return (new_text, new_cursor_position) for this completion.
N) r>r<<00>text<78>cursor_position<6F>text_before_cursor<6F>text_after_cursorr=<00>start_positionrQ)rG<00>original_text_before_cursor<6F>original_text_after_cursor<6F>c<>before<72>new_text<78>new_cursor_positions& r3<00>new_text_and_position<6F>%CompletionState.new_text_and_positiones<><00><00> <10> <1E> <1E> &<26><17>)<29>)<29>.<2E>.<2E><04>0F<30>0F<30>0V<30>0V<30>V<> V<>*.<2E>*@<40>*@<40>*S<>*S<> '<27>)-<2D>)?<3F>)?<3F>)Q<>)Q<> &<26><14> <20> <20><14>!4<>!4<>5<>A<EFBFBD><10><1F><1F>1<EFBFBD>$<24>4<><06>4<>5G<35>q<EFBFBD>7G<37>7G<37>H<><06><1D><06><06><EFBFBD>)C<>C<>H<EFBFBD>"%<25>f<EFBFBD>+<2B><03>A<EFBFBD>F<EFBFBD>F<EFBFBD> <0B>";<3B> <1F><1B>0<> 0r2c<01><00>V^8<>dQhRR/#)r;r@zCompletion | Noner*)rBs"r3rCrDzs<00><00><14><14>$5<>r2c <0A>\<00>VPeVPVP,#R#)zQ
Return the current completion, or return `None` when no completion is
selected.
N)r>r=rRs&r3<00>current_completion<6F>"CompletionState.current_completionys*<00><00> <10> <1E> <1E> *<2A><17>#<23>#<23>D<EFBFBD>$7<>$7<>8<> 8<>r2)r>r=r<)NN) r,r-r.r/r0rHrSrZri<00>propertyrmr1r*r2r3r(r(Bs0<00><00><08>-<2D>"P<02>(<28>1<>(<0E><14><0E>r2z(\s+|".*?"|'.*?')c<01>6<00>]tRt^<5E>tRtRRRlltRRltRtR#) <09>YankNthArgStatezL
For yank-last-arg/yank-nth-arg: Keep track of where we are in the history.
c<01>(<00>V^8<>dQhRRRRRRRR/#)r;<00>history_position<6F>int<6E>n<>previous_inserted_wordrLr@rAr*)rBs"r3rC<00>YankNthArgState.__annotate__<5F>s,<00><00><13><13> #<23><13>,/<2F><13>NQ<4E><13> <0A>r2c <09>*<00>WnW0nW nR#rF)rsrvru)rGrsrurvs&&&&r3rH<00>YankNthArgState.__init__<5F>s<00><00>!1<><1D>&<<3C>#<23><12>r2c<01><00>V^8<>dQhRR/#rKr*)rBs"r3rCrw<00>s<00><00>^<02>^<02>#<23>^r2c <09><><00>VPP RVP: RVP: RVP: R2#)z(history_position=z, n=z, previous_inserted_word=rO)rPr,rsrurvrRs&r3rS<00>YankNthArgState.__repr__<5F>sa<00><00><16>.<2E>.<2E>)<29>)<29>*<2A>*<<3C>T<EFBFBD>=R<>=R<><U<>UY<55>Z^<5E>Z`<60>Z`<60>Yc<59>c|<7C>~B<02>~Y<02>~Y<02>}\<02>\]<02>^<02> ^r2)rsrurvN)<03><00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)r,r-r.r/r0rHrSr1r*r2r3rqrq<00>s<00><00><08><13>^<02>^r2rqc<01><><00>]tRt^<5E>tRtR<>RRlltRRltR<>RRlltR R
ltR R lt R Rlt
] RRl4t ] PRRl4t ] RRl4t]PRRl4t] RRl4t]PRRl4tRRltRRlt] RR l4t]PR!R"l4tR<>R#R$llt] R%R&l4tR<>R'R(lltR)R*ltR+R,ltR-R.ltR<>R/R0lltR<>R1R2lltR<>R3R4lltR<>R5R6lltR<>R7R8lltR<>R9R:lltR<>R;R<lltR<>R=R>llt R<>R?R@llt!R<>RARBllt"RCRDlt#RERFlt$R<>RGRHllt%R<>RIRJllt&RKRLlt'RMRNlt(RORPlt)RQRRlt*RSRTlt+RURVlt,RWRXlt-R<>RYRZllt.R<>R[R\llt/R<>R]R^llt0R<30>R_R`llt1]2Pf3RaRbllt4R<34>RcRdllt5ReRflt6]7Pp^3RgRhllt9R<39>RiRjllt:R<>RkRlllt;R<>RmRnllt<R<>RoRpllt=RqRrlt>RsRtlt?R<>RuRvllt@RwRxltARyRzltBR<42>R{R|lltCR}R~ltDR<44>RR<>lltER<45>R<EFBFBD>R<>lltFR<46>R<>ltGR<47>R<>ltHR<48>R<>ltIR<49>R<EFBFBD>R<>lltJR<4A>R<>ltKR<4B>R<EFBFBD>R<>lltLR<4C>R<>ltMR<4D>R<>ltNR<4E>R<>ltOR<4F>R<>ltPR<50>tQR#)<29>r'a
The core data structure that holds the text and cursor position of the
current input line and implements all text manipulations on top of it. It
also implements the history, undo stack and the completion state.
:param completer: :class:`~prompt_toolkit.completion.Completer` instance.
:param history: :class:`~prompt_toolkit.history.History` instance.
:param tempfile_suffix: The tempfile suffix (extension) to be used for the
"open in editor" function. For a Python REPL, this would be ".py", so
that the editor knows the syntax highlighting to use. This can also be
a callable that returns a string.
:param tempfile: For more advanced tempfile situations where you need
control over the subdirectories and filename. For a Git Commit Message,
this would be ".git/COMMIT_EDITMSG", so that the editor knows the syntax
highlighting to use. This can also be a callable that returns a string.
:param name: Name for this buffer. E.g. DEFAULT_BUFFER. This is mostly
useful for key bindings where we sometimes prefer to refer to a buffer
by their name instead of by reference.
:param accept_handler: Called when the buffer input is accepted. (Usually
when the user presses `enter`.) The accept handler receives this
`Buffer` as input and should return True when the buffer text should be
kept instead of calling reset.
In case of a `PromptSession` for instance, we want to keep the text,
because we will exit the application, and only reset it during the next
run.
:param max_number_of_completions: Never display more than this number of
completions, even when the completer can produce more (limited by
default to 10k for performance).
Events:
:param on_text_changed: When the buffer text changes. (Callable or None.)
:param on_text_insert: When new text is inserted. (Callable or None.)
:param on_cursor_position_changed: When the cursor moves. (Callable or None.)
:param on_completions_changed: When the completions were changed. (Callable or None.)
:param on_suggestion_set: When an auto-suggestion text has been set. (Callable or None.)
Filters:
:param complete_while_typing: :class:`~prompt_toolkit.filters.Filter`
or `bool`. Decide whether or not to do asynchronous autocompleting while
typing.
:param validate_while_typing: :class:`~prompt_toolkit.filters.Filter`
or `bool`. Decide whether or not to do asynchronous validation while
typing.
:param enable_history_search: :class:`~prompt_toolkit.filters.Filter` or
`bool` to indicate when up-arrow partial string matching is enabled. It
is advised to not enable this at the same time as
`complete_while_typing`, because when there is an autocompletion found,
the up arrows usually browse through the completions, rather than
through the history.
:param read_only: :class:`~prompt_toolkit.filters.Filter`. When True,
changes will not be allowed.
:param multiline: :class:`~prompt_toolkit.filters.Filter` or `bool`. When
not set, pressing `Enter` will call the `accept_handler`. Otherwise,
pressing `Esc-Enter` is required.
Nc*<01>l<00>V^8<>dQhRRRRRRRRR R
R R
R R RRRRRRRRRRRRRRRRRRRRRRRRRRR R!/#)"r;<00> completerzCompleter | None<6E> auto_suggestzAutoSuggest | None<6E>historyzHistory | None<6E> validatorzValidator | None<6E>tempfile_suffixzstr | Callable[[], str]<5D>tempfile<6C>namerL<00>complete_while_typingr<00>validate_while_typing<6E>enable_history_search<63>document<6E>Document | None<6E>accept_handlerzBufferAcceptHandler | None<6E> read_only<6C> multiline<6E>max_number_of_completionsrt<00>on_text_changedzBufferEventHandler | None<6E>on_text_insert<72>on_cursor_position_changed<65>on_completions_changed<65>on_suggestion_setr@rAr*)rBs"r3rC<00>Buffer.__annotate__<5F>s<><00><00>O&<26>O&<26>#<23>O&<26>)<29>O&<26> <20> O&<26>
$<24> O&<26> 1<> O&<26>*<2A>O&<26><12>O&<26> ,<2C>O&<26> ,<2C>O&<26> ,<2C>O&<26>"<22>O&<26>3<>O&<26> <20>O&<26> <20>O&<26> $'<27>!O&<26>"3<>#O&<26>$2<>%O&<26>&%><3E>'O&<26>(!:<3A>)O&<26>*5<>+O&<26>,
<0E>-O&r2c <09><00>\V
4p
\V4p\V 4p \V 4p \V4pT;'g \4VnW nW@nWPnW`nWpnW<>nW<>n W<>n
W<>n W<>n W<>n W<>n^VnVf \!4MTVn^Vn\'VV4Vn\'VV4Vn\'VV4Vn\'VV4Vn\'VV4Vn\3\4^
R7VnVP94VnVP=4VnVPA4Vn!RVn"VPGV R7R#)r}N)<01>size)r<>)$rrr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<><00>
text_widthrr<><00>_Buffer__cursor_positionr"r<>r<>r<>r<>r<>rr<00>_document_cache<68>_create_auto_suggest_coroutine<6E>_async_suggester<65>_create_completer_coroutine<6E>_async_completer<65>_create_auto_validate_coroutine<6E>_async_validator<6F>_load_history_task<73>reset)rGr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>s&&&&&&&&&&&&&&&&&&&&&r3rH<00>Buffer.__init__<5F>sp<00><00>0!*<2A>*?<3F> @<40><1D> )<29>*?<3F> @<40><1D> )<29>*?<3F> @<40><1D><1D>i<EFBFBD>(<28> <09><1D>i<EFBFBD>(<28> <09>"<22>6<>6<>n<EFBFBD>&6<><04><0E>(<28><19>"<22><0E>.<2E><1C> <20> <0A><18> <09>,<2C><1B>&;<3B>"<22>%:<3A>"<22>%:<3A>"<22>"<22><0E>"<22><0E>)B<>&<26><1C><04><0F>
-4<>O<EFBFBD><EFBFBD>(<28><17><04> <0C>!"<22><04><1E>/4<>D<EFBFBD>/<2F>.J<><04><1C>-2<>4<EFBFBD><1E>-H<><04><1B>9><3E> <10>,<2C>:
<EFBFBD><04>'<27>6;<3B>4<EFBFBD>AW<41>5X<35><04>#<23>05<30>d<EFBFBD><M<>0N<30><04><1E>
<1A>(<28><12> ,<2C> <0A><1C>
!%<25> C<> C<> E<><04><1D> $<24> @<40> @<40> B<><04><1D> $<24> D<> D<> F<><04><1D>@D<01><04><1F> <0A>
<EFBFBD>
<EFBFBD>H<EFBFBD>
<EFBFBD>%r2c<01><00>V^8<>dQhRR/#rKr*)rBs"r3rCr<>(s<00><00>N<01>N<01>#<23>Nr2c <09><><00>\VP4^8dVPpMVPR,R,pRVP: RV: R\V4: R2#)<07>:N<> Nz...z <Buffer(name=z, text=z) at <20>>)rQr^r<><00>id)rGr^s& r3rS<00>Buffer.__repr__(sP<00><00> <0E>t<EFBFBD>y<EFBFBD>y<EFBFBD>><3E>B<EFBFBD> <1E><17>9<EFBFBD>9<EFBFBD>D<EFBFBD><17>9<EFBFBD>9<EFBFBD>S<EFBFBD>><3E>E<EFBFBD>)<29>D<EFBFBD><1E>t<EFBFBD>y<EFBFBD>y<EFBFBD>m<EFBFBD>7<EFBFBD>4<EFBFBD>(<28>%<25><02>4<EFBFBD><08>|<7C>1<EFBFBD>M<>Mr2c<01>$<00>V^8<>dQhRRRRRR/#)r;r<>r<><00>append_to_history<72>boolr@rAr*)rBs"r3rCr<>0s$<00><00>?!<21>?!<21>'<27>?!<21>CG<43>?!<21> <0A>?!r2c <0A><><00>V'dVP4T;'g \4pVPVnRVn\
P VnRVn.Vn RVn
RVn RVn RVn RVnRVn.Vn.VnVP$eVP$P'4RVn\)VP*.4Vn^VnR#)zB
:param append_to_history: Append current input to history first.
N)r<>rr_r<><00>validation_errorr5r8<00>validation_state<74>selection_state<74>multiple_cursor_positions<6E>preferred_column<6D>complete_state<74>yank_nth_arg_state<74>document_before_paste<74>
suggestion<EFBFBD>history_search_text<78> _undo_stack<63> _redo_stackr<6B><00>cancelrr^<00>_working_lines<65>_Buffer__working_index)rGr<>r<>s&&&r3r<><00> Buffer.reset0s<><00><00> <1D> <10> "<22> "<22> $<24><1B>)<29>)<29>x<EFBFBD>z<EFBFBD><08>!)<29>!9<>!9<><04><1E>9=<3D><04><1D>8G<38>8O<38>8O<38><04><1D>7;<3B><04><1C>
57<35><04>&<26>-1<><04><1D>7;<3B><04><1B>;?<3F><04><1F>7;<3B><04>"<22>.2<EFBFBD><04><0F>04<30><04> <20>35<33><04><18>24<32><04><18>
<10> "<22> "<22> .<2E> <10> #<23> #<23> *<2A> *<2A> ,<2C>"&<26><04><1F>+0<><18><1D><1D><0F>*@<40><04><1B> <20><04>r2c<01><00>V^8<>dQhRR/#<00>r;r@rAr*)rBs"r3rCr<>qs<00><00>3I<01>3I<01><04>3Ir2c <0A><>a<00>SPfPRV3Rllp\4PV!44SnRRlpSPPV4R#R#)a~
Create task for populating the buffer history (if not yet done).
Note::
This needs to be called from within the event loop of the
application, because history loading is async, and we need to be
sure the right event loop is active. Therefor, we call this method
in the `BufferControl.create_content`.
There are situations where prompt_toolkit applications are created
in one thread, but will later run in a different thread (Ptpython
is one example. The REPL runs in a separate thread, in order to
prevent interfering with a potential different event loop in the
main thread. The REPL UI however is still created in the main
thread.) We could decide to not support creating prompt_toolkit
objects in one thread and running the application in a different
thread, but history loading is the only place where it matters, and
this solves it.
Nc<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rC<00>;Buffer.load_history_if_not_yet_loaded.<locals>.__annotate__<5F>s<00><00> .<2E> .<2E><04> .r2c<00><01><><"<00>SPP4Rjx<01>L
pSPPV4S;P^, unK@L;D<R#5irF)r<><00>loadr<64><00>
appendleftr<EFBFBD>)<02>itemrGs <20>r3<00> load_history<72>;Buffer.load_history_if_not_yet_loaded.<locals>.load_history<72>sO<00><><00><00>"&<26>,<2C>,<2C>"3<>"3<>"5<>.<2E>.<2E>$<24><18>'<27>'<27>2<>2<>4<EFBFBD>8<><18>(<28>(<28>A<EFBFBD>-<2D>(<28>.<2E>"5<>s%<00>A#<01>A <02>A<06>A <02>8A#<01>A <02> A#c<01> <00>V^8<>dQhRRRR/#)r;<00>fzasyncio.Future[None]r@rAr*)rBs"r3rCr<><00>s<00><00> ?<3F> ?<3F>%9<> ?<3F>d<EFBFBD> ?r2c<05><><00>VP4R# \PdR#\dR#\d\
P R4R#i;i)z\
Handle `load_history` result when either done, cancelled, or
when an exception was raised.
zLoading history failedN)<07>result<6C>asyncio<69>CancelledError<6F> GeneratorExit<69> BaseException<6F>logger<65> exception)r<>s&r3<00>load_history_done<6E>@Buffer.load_history_if_not_yet_loaded.<locals>.load_history_done<6E>sP<00><00>
?<3F><15>H<EFBFBD>H<EFBFBD>J<EFBFBD><4A><1E>-<2D>-<2D><19><19>$<24><19><19>$<24>?<3F><1B>$<24>$<24>%=<3D>><3E>?<3F>s$<00><00>A<03>A<03>A<03>A<03>A<03>A)r<>r <00>create_background_task<73>add_done_callback)rGr<>r<>sf r3<00>load_history_if_not_yet_loaded<65>%Buffer.load_history_if_not_yet_loadedqsU<00><><00>* <10> "<22> "<22> *<2A> .<2E> .<2E>
'.<2E>i<EFBFBD>&F<>&F<>|<7C>~<7E>&V<>D<EFBFBD> #<23> ?<3F>* <11> #<23> #<23> 5<> 5<>6G<36> H<>= +r2c<01> <00>V^8<>dQhRRRR/#)r;<00>valuerLr@r<>r*)rBs"r3rCr<><00>s<00><00><15><15>s<EFBFBD><15>t<EFBFBD>r2c <0A><><00>VPpVPpW2,pWV&\V4\V48wdR#W8wdR#R#)z=set text at current working_index. Return whether it changed.TF)<03> working_indexr<78>rQ)rGr<>r<><00> working_lines<65>original_values&& r3<00> _set_text<78>Buffer._set_text<78>sL<00><00><1C>*<2A>*<2A> <0A><1C>+<2B>+<2B> <0A>&<26>5<><0E>',<2C>m<EFBFBD>$<24> <0F>u<EFBFBD>:<3A><13>^<5E>,<2C> ,<2C> <18> <12> $<24><17>r2c<01> <00>V^8<>dQhRRRR/#)r;r<>rtr@r<>r*)rBs"r3rCr<><00>s<00><00>;<3B>;<3B>#<23>;<3B>$<24>;r2c <0A>Z<00>VPp\^V4VnVPV8g#)z/Set cursor position. Return whether it changed.)r<><00>max)rGr<><00>original_positions&& r3<00>_set_cursor_position<6F>Buffer._set_cursor_position<6F>s.<00><00> <20>2<>2<><19>!$<24>Q<EFBFBD><05><1D><04><1E><13>%<25>%<25>):<3A>:<3A>:r2c<01><00>V^8<>dQhRR/#rKr*)rBs"r3rCr<><00>s<00><00>7<>7<>c<EFBFBD>7r2c <09><<00>VPVP,#rF)r<>r<>rRs&r3r^<00> Buffer.text<78>s<00><00><13>"<22>"<22>4<EFBFBD>#5<>#5<>6<>6r2c<01> <00>V^8<>dQhRRRR/#)r;r<>rLr@rAr*)rBs"r3rCr<><00>s<00><00>,<2C>,<2C>#<23>,<2C>$<24>,r2c <0A><><00>VP\V48<>d\V4VnVP4'd \4hVP V4pV'dVP 4RVnR#R#)z<>
Setting text. (When doing this, make sure that the cursor_position is
valid for this text. text/cursor_position should be consistent at any time,
otherwise set a Document instead.)
N)r_rQr<>r&r<><00> _text_changedr<64><00>rGr<><00>changeds&& r3r^r<><00>sf<00><00> <10> <1F> <1F>#<23>e<EFBFBD>*<2A> ,<2C>#&<26>u<EFBFBD>:<3A>D<EFBFBD> <20> <10>><3E>><3E> <1B> <1B>$<24>&<26> &<26><16>.<2E>.<2E><15>'<27><07> <12> <10> <1E> <1E> <20> (,<2C>D<EFBFBD> $<24> r2c<01><00>V^8<>dQhRR/#<00>r;r@rtr*)rBs"r3rCr<><00>s<00><00>&<26>&<26><13>&r2c <09><00>VP#rF)r<>rRs&r3r_<00>Buffer.cursor_position<6F>s<00><00><13>%<25>%<25>%r2c<01> <00>V^8<>dQhRRRR/#<00>r;r<>rtr@rAr*)rBs"r3rCr<><00>s<00><00>,<2C>,<2C>S<EFBFBD>,<2C>T<EFBFBD>,r2c <0A><><00>\V\4'gQhV\VP48<>d\VP4pV^8d^pVP V4pV'dVP 4R#R#)z
Setting cursor position.
N)<06>
isinstancertrQr^r<><00>_cursor_position_changedr<64>s&& r3r_r<><00>sf<00><00>
<1A>%<25><13>%<25>%<25>%<25>%<25> <11>3<EFBFBD>t<EFBFBD>y<EFBFBD>y<EFBFBD>><3E> !<21><17><04> <09> <09>N<EFBFBD>E<EFBFBD> <10>1<EFBFBD>9<EFBFBD><15>E<EFBFBD><16>+<2B>+<2B>E<EFBFBD>2<><07> <12> <10> )<29> )<29> +<2B> r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<><00>s<00><00>$<24>$<24>s<EFBFBD>$r2c <09><00>VP#rF)r<>rRs&r3r<><00>Buffer.working_index<65>s<00><00><13>#<23>#<23>#r2c<01> <00>V^8<>dQhRRRR/#r<>r*)rBs"r3rCr<><00>s<00><00>!<21>!<21>3<EFBFBD>!<21>4<EFBFBD>!r2c <09>f<00>VPV8wd Wn^VnVP4R#R#)r}N)r<>r_r<><00>rGr<>s&&r3r<>r<><00>s1<00><00> <0F> <1F> <1F>5<EFBFBD> (<28>#(<28> <20>$%<25>D<EFBFBD> <20> <10> <1E> <1E> <20> )r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<>s<00><00>F<01>F<01>t<EFBFBD>Fr2c <09>l<00>RVn\PVnRVnRVnRVnRVnRVnRVn VPP4VP'dBVP4'd*\4PVP!44R#R#R#rF)r<>r5r8r<>r<>r<>r<>r<>r<>r<>r<><00>firer<65>r<>r r<>r<>rRs&r3r<><00>Buffer._text_changeds<><00><00> $<24><04><1D> /<2F> 7<> 7<><04><1D>"<22><04><1B>"&<26><04><1F>%)<29><04>"<22>#<23><04><1C><1E><04><0F> $<24><04><1D> <0A><1C><1C>!<21>!<21>#<23>
<10>><3E>><3E>><3E>d<EFBFBD>8<>8<>:<3A>:<3A> <13>I<EFBFBD> ,<2C> ,<2C>T<EFBFBD>-B<>-B<>-D<> E<>;<3B>>r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<>s<00><00>/<2F>/<2F>$<24>/r2c <09>r<00>RVnRVnRVnRVnVPP 4R#rF)r<>r<>r<>r<>r<>rrRs&r3r<><00>Buffer._cursor_position_changeds:<00><00>#<23><04><1B>"&<26><04><1F>%)<29><04>"<22>!%<25><04><1D> <0A>'<27>'<27>,<2C>,<2C>.r2c<01><00>V^8<>dQhRR/#)r;r@rr*)rBs"r3rCr<>,s<00><00>
<EFBFBD>
<EFBFBD>(<28>
r2c <0A>j<00>VPVPVPVP3,#)zx
Return :class:`~prompt_toolkit.document.Document` instance from the
current text, cursor position and selection state.
)r<>r^r_r<>rRs&r3r<><00>Buffer.document+s1<00><00> <14>#<23>#<23> <10>I<EFBFBD>I<EFBFBD>t<EFBFBD>+<2B>+<2B>T<EFBFBD>-A<>-A<> A<>
<EFBFBD>
r2c<01> <00>V^8<>dQhRRRR/#)r;r<>rr@rAr*)rBs"r3rCr<>6s<00><00>!<21>!<21>h<EFBFBD>!<21>4<EFBFBD>!r2c <0A>(<00>VPV4R#)z<>
Set :class:`~prompt_toolkit.document.Document` instance.
This will set both the text and cursor position at the same time, but
atomically. (Change events will be triggered only after both have been set.)
N)<01> set_documentrs&&r3r<>r
5s<00><00> <0A><19><19>%<25> r2c<01>$<00>V^8<>dQhRRRRRR/#)r;r<>r<00>bypass_readonlyr<79>r@rAr*)rBs"r3rCr<>?s!<00><00>!,<2C>!,<2C>(<28>!,<2C>T<EFBFBD>!,<2C>d<EFBFBD>!,r2c <0A>4<00>V'g!VP4'd \4hVPVP4pVP VP
4pV'dVP 4RVnV'dVP4R#R#)a<>
Set :class:`~prompt_toolkit.document.Document` instance. Like the
``document`` property, but accept an ``bypass_readonly`` argument.
:param bypass_readonly: When True, don't raise an
:class:`.EditReadOnlyBuffer` exception, even
when the buffer is read-only.
.. warning::
When this buffer is read-only and `bypass_readonly` was not passed,
the `EditReadOnlyBuffer` exception will be caught by the
`KeyProcessor` and is silently suppressed. This is important to
keep in mind when writing key bindings, because it won't do what
you expect, and there won't be a stack trace. Use try/finally
around this function if you need some cleanup code.
N) r<>r&r<>r^r<>r_r<>r<>r<>)rGr<>r<00> text_changed<65>cursor_position_changeds&&& r3r <00>Buffer.set_document?st<00><00>&<1F>4<EFBFBD>><3E>><3E>#3<>#3<>$<24>&<26> &<26><1C>~<7E>~<7E>e<EFBFBD>j<EFBFBD>j<EFBFBD>1<> <0C>"&<26>";<3B>";<3B>E<EFBFBD><Q<><Q<>"R<><1F> <18> <10> <1E> <1E> <20>'+<2B>D<EFBFBD> $<24> "<22> <10> )<29> )<29> +<2B> #r2c<01><00>V^8<>dQhRR/#<00>r;r@r<>r*)rBs"r3rCr<>cs<00><00>)<29>)<29>t<EFBFBD>)r2c <0A>,<00>\VP4#)z/
True when there is something handling accept.
)r<>r<>rRs&r3<00> is_returnable<6C>Buffer.is_returnablebs<00><00>
<14>D<EFBFBD>'<27>'<27>(<28>(r2c<01> <00>V^8<>dQhRRRR/#)r;<00>clear_redo_stackr<6B>r@rAr*)rBs"r3rCr<>ks<00><00>"<22>"<22>4<EFBFBD>"<22>4<EFBFBD>"r2c <0A>h<00>VP'd^VPR,^,VP8Xd5VPR,^,VP3VPR&M1VPPVPVP34V'd
.VnR#R#)za
Safe current state (input text and cursor position), so that we can
restore it by calling undo.
Nr~)r<>r^r_<00>appendr<64>)rGrs&&r3<00>save_to_undo_stack<63>Buffer.save_to_undo_stackks<><00><00> <10> <1B> <1B> <1B><04> 0<> 0<><12> 4<>Q<EFBFBD> 7<>4<EFBFBD>9<EFBFBD>9<EFBFBD> D<>$(<28>$4<>$4<>R<EFBFBD>$8<><11>$;<3B>T<EFBFBD>=Q<>=Q<>#R<>D<EFBFBD> <1C> <1C>R<EFBFBD> <20> <10> <1C> <1C> #<23> #<23>T<EFBFBD>Y<EFBFBD>Y<EFBFBD><04>0D<30>0D<30>$E<> F<> <1C>!<21>D<EFBFBD> <1C> r2c<01>$<00>V^8<>dQhRRRRRR/#)r;<00>line_index_iteratorz Iterable[int]<5D>transform_callback<63>Callable[[str], str]r@rLr*)rBs"r3rCr<>{s(<00><00> <20> <20>*<2A> <20>1<> <20>
<0A>  r2c <0A><><00>VPPR4pVFpV!W4,4W4&K RPV4# \dK7i;i)a<>
Transforms the text on a range of lines.
When the iterator yield an index not in the range of lines that the
document contains, it skips them silently.
To uppercase some lines::
new_text = transform_lines(range(5,10), lambda text: text.upper())
:param line_index_iterator: Iterator of line numbers (int)
:param transform_callback: callable that takes the original text of a
line, and return the new text for this line.
:returns: The new text.
<EFBFBD>
)r^<00>split<69>
IndexError<EFBFBD>join)rGr r!<00>linesrWs&&& r3<00>transform_lines<65>Buffer.transform_lines{sZ<00><00>*<15> <09> <09><0F><0F><04>%<25><05>)<29>E<EFBFBD> <15>1<>%<25>,<2C>?<3F><05> <0C>)<29> <14>y<EFBFBD>y<EFBFBD><15><1F><1F><><1E> <15><14> <15>s<00>A<02> A<05>Ac<01> <00>V^8<>dQhRRRR/#)r;r!r"r@rAr*)rBs"r3rCr<><00>s<00><00> 
<EFBFBD> 
<EFBFBD>9M<EFBFBD> 
<EFBFBD>RV<EFBFBD> 
r2c <0A>$<00>VPpVPVP4,pVPVP4,pVPRVV!VPW44,VPVR,VnR#)z<>
Apply the given transformation function to the current line.
:param transform_callback: callable that takes a string and return a new string.
N)r<>r_<00>get_start_of_line_position<6F>get_end_of_line_positionr^)rGr!r<><00>a<>bs&& r3<00>transform_current_line<6E>Buffer.transform_current_line<6E>s}<00><00> <18>=<3D>=<3D><08> <14> $<24> $<24>x<EFBFBD>'J<>'J<>'L<> L<><01> <14> $<24> $<24>x<EFBFBD>'H<>'H<>'J<> J<><01> <14>M<EFBFBD>M<EFBFBD>"<22>1<EFBFBD> <1D> <20><18><1D><1D>q<EFBFBD>!3<>4<> 5<><16>m<EFBFBD>m<EFBFBD>A<EFBFBD>B<EFBFBD><1F> <20> <0A> r2c<01>(<00>V^8<>dQhRRRRRRRR/#)r;<00>from_rt<00>tor!r"r@rAr*)rBs"r3rCr<><00>s,<00><00>
<EFBFBD>
<EFBFBD><18>
<EFBFBD>!<21>
<EFBFBD>7K<EFBFBD>
<EFBFBD> <0A>
r2c <0A><><00>W8gQhRPVPRVV!VPW4,VPVR,.4VnR#)z<>
Transform a part of the input string.
:param from_: (int) start position.
:param to: (int) end position.
:param transform_callback: Callable which accepts a string and returns
the transformed string.
rN)r'r^)rGr4r5r!s&&&&r3<00>transform_region<6F>Buffer.transform_region<6F>sY<00><00><15>z<EFBFBD><19>z<EFBFBD><16>G<EFBFBD>G<EFBFBD><14> <09> <09>&<26>5<EFBFBD>!<21>$<24>T<EFBFBD>Y<EFBFBD>Y<EFBFBD>u<EFBFBD>%8<>9<>:<3A><16>)<29>)<29>B<EFBFBD>C<EFBFBD>.<2E>!<21> <0E>
<EFBFBD><04> r2c<01> <00>V^8<>dQhRRRR/#<00>r;<00>countrtr@rAr*)rBs"r3rCr<><00>s<00><00>T<01>T<01><13>T<01>T<EFBFBD>Tr2c <09>l<00>V;PVPPVR7, unR#<00><02>r;N)r_r<><00>get_cursor_left_position<6F>rGr;s&&r3<00> cursor_left<66>Buffer.cursor_left<66>s%<00><00> <0C><1C><1C><04> <0A> <0A> F<> F<>U<EFBFBD> F<> S<>S<>r2c<01> <00>V^8<>dQhRRRR/#r:r*)rBs"r3rCr<><00>s<00><00>U<01>U<01>#<23>U<01>d<EFBFBD>Ur2c <09>l<00>V;PVPPVR7, unR#r=)r_r<><00>get_cursor_right_positionr@s&&r3<00> cursor_right<68>Buffer.cursor_right<68>s%<00><00> <0C><1C><1C><04> <0A> <0A> G<> G<>e<EFBFBD> G<> T<>T<>r2c<01> <00>V^8<>dQhRRRR/#r:r*)rBs"r3rCr<><00>s<00><00>0<>0<>s<EFBFBD>0<>4<EFBFBD>0r2c <0A><><00>VP;'gVPPpV;PVPP WR7, unW nR#)z7(for multiline edit). Move cursor to the previous line.<2E>r;r<>N)r<>r<><00>cursor_position_colr_<00>get_cursor_up_position<6F>rGr;<00>original_columns&& r3<00> cursor_up<75>Buffer.cursor_up<75>sR<00><00><1E>/<2F>/<2F>T<>T<>4<EFBFBD>=<3D>=<3D>3T<33>3T<33><0F> <0C><1C><1C><04> <0A> <0A> D<> D<><17>!E<01>!
<EFBFBD>
<EFBFBD><1C>
!0<>r2c<01> <00>V^8<>dQhRRRR/#r:r*)rBs"r3rCr<><00>s<00><00>0<>0<><13>0<>T<EFBFBD>0r2c <0A><><00>VP;'gVPPpV;PVPP WR7, unW nR#)z3(for multiline edit). Move cursor to the next line.rJN)r<>r<>rKr_<00>get_cursor_down_positionrMs&& r3<00> cursor_down<77>Buffer.cursor_down<77>sR<00><00><1E>/<2F>/<2F>T<>T<>4<EFBFBD>=<3D>=<3D>3T<33>3T<33><0F> <0C><1C><1C><04> <0A> <0A> F<> F<><17>!G<01>!
<EFBFBD>
<EFBFBD><1C>
!0<>r2c<01>$<00>V^8<>dQhRRRRRR/#<00>r;r;rt<00>&go_to_start_of_line_if_history_changesr<73>r@rAr*)rBs"r3rCr<><00><00>)<00><00>S<01>S<01><18>S<01>FJ<46>S<01> <0A>Sr2c <0A>r<00>VP'dVPVR7R#VPP^8<>dVP VR7R#VP
'gPVP VR7V'd4V;PVPP4, unR#R#R#)z}
If we're not on the first line (of a multiline input) go a line up,
otherwise go back in history. (If nothing is selected.)
r>N) r<><00>complete_previousr<73><00>cursor_position_rowrOr<><00>history_backwardr_r-<00>rGr;rXs&&&r3<00>auto_up<75>Buffer.auto_up<75>s<><00><00> <10> <1E> <1E> <1E> <10> "<22> "<22><15> "<22> /<2F> <11>]<5D>]<5D> .<2E> .<2E><11> 2<> <10>N<EFBFBD>N<EFBFBD><15>N<EFBFBD> '<27><15>%<25>%<25>%<25> <10> !<21> !<21><05> !<21> .<2E>6<><14>$<24>$<24><04> <0A> <0A>(P<>(P<>(R<>R<>$<24>6<> &r2c<01>$<00>V^8<>dQhRRRRRR/#rWr*)rBs"r3rCr<><00>rYr2c <0A><><00>VP'dVPVR7R#VPPVPP^,
8dVP VR7R#VP 'gPVPVR7V'd4V;PVPP4, unR#R#R#)z<>
If we're not on the last line (of a multiline input) go a line down,
otherwise go forward in history. (If nothing is selected.)
r>N)
r<EFBFBD><00> complete_nextr<74>r\<00>
line_countrTr<><00>history_forwardr_r-r^s&&&r3<00> auto_down<77>Buffer.auto_down<77>s<><00><00> <10> <1E> <1E> <1E> <10> <1E> <1E>U<EFBFBD> <1E> +<2B> <11>]<5D>]<5D> .<2E> .<2E><14><1D><1D>1I<31>1I<31>A<EFBFBD>1M<31> M<> <10> <1C> <1C>5<EFBFBD> <1C> )<29><15>%<25>%<25>%<25> <10> <20> <20>u<EFBFBD> <20> -<2D>6<><14>$<24>$<24><04> <0A> <0A>(P<>(P<>(R<>R<>$<24>6<> &r2c<01> <00>V^8<>dQhRRRR/#<00>r;r;rtr@rLr*)rBs"r3rCr<><00>s<00><00><17><17>#<23><17>c<EFBFBD>r2c <0A>f<00>V^8<>gQhRpVP^8<>d<>VPVPV,
VPpVPRVPV,
VPVPR,pVP\V4,
p\W44VnV#)zR
Delete specified number of characters before cursor and return the
deleted text.
rN)r_r^rQrr<>)rGr;<00>deletedrgrhs&& r3<00>delete_before_cursor<6F>Buffer.delete_before_cursor<6F>s<><00><00>
<15><01>z<EFBFBD><19>z<EFBFBD><14><07> <0F> <1F> <1F>!<21> #<23><1A>i<EFBFBD>i<EFBFBD><04> 4<> 4<>u<EFBFBD> <<3C>t<EFBFBD>?S<>?S<>T<>G<EFBFBD><15> <09> <09>8<>D<EFBFBD>0<>0<>5<EFBFBD>8<>9<><16>)<29>)<29>D<EFBFBD>0<>0<>2<>3<>4<> <15>#'<27>"6<>"6<><13>W<EFBFBD><1C>"E<> <1F>%<25>X<EFBFBD>C<>D<EFBFBD>M<EFBFBD><16>r2c<01> <00>V^8<>dQhRRRR/#rir*)rBs"r3rCr<>s<00><00> <16> <16>C<EFBFBD> <16><03> r2c <0A><00>VP\VP48dhVPPRVpVPRVPVPVP\V4,R,VnV#R#)zD
Delete specified number of characters and Return the deleted text.
Nr)r_rQr^r<>ra)rGr;rks&& r3<00>delete<74> Buffer.deletesz<00><00> <10> <1F> <1F>#<23>d<EFBFBD>i<EFBFBD>i<EFBFBD>.<2E> 0<><1A>m<EFBFBD>m<EFBFBD>5<>5<>f<EFBFBD>u<EFBFBD>=<3D>G<EFBFBD><14> <09> <09>0<>D<EFBFBD>0<>0<>1<><16>)<29>)<29>D<EFBFBD>0<>0<>3<EFBFBD>w<EFBFBD><<3C>?<3F>A<>B<>C<01> <11>I<EFBFBD><1B>N<EFBFBD>r2c<01> <00>V^8<>dQhRRRR/#<00>r;<00> separatorrLr@rAr*)rBs"r3rCr<>!s<00><00><0E><0E><03><0E>d<EFBFBD>r2c <0A>\<00>VPP'g<>V;PVPP4, unVP 4VPP
V,VPP PR4,VnR#R#)z[
Join the next line to the current one by deleting the line ending after
the current line.
<EFBFBD> N) r<><00> on_last_liner_r.rpr`ra<00>lstripr^)rGrts&&r3<00>join_next_line<6E>Buffer.join_next_line!s{<00><00>
<14>}<7D>}<7D>)<29>)<29>)<29> <10> <20> <20>D<EFBFBD>M<EFBFBD>M<EFBFBD>$J<>$J<>$L<> L<> <20> <10>K<EFBFBD>K<EFBFBD>M<EFBFBD><15> <0A> <0A>0<>0<><1B><1C><16>-<2D>-<2D>1<>1<>8<>8<><13>=<3D>><3E> <11>I<EFBFBD> *r2c<01> <00>V^8<>dQhRRRR/#rsr*)rBs"r3rCr<>1s<00><00>
<EFBFBD>
<EFBFBD>S<EFBFBD>
<EFBFBD>4<EFBFBD>
r2c  <0A><00>VP'gQh\VPVPP.4wr#VPRVpVPW#P 4pVPVRpVUu.uFqwP R4V,NK pp\VRPV4,V,\VRPVRR4,4^,
R7Vn
R#uupi)z
Join the selected lines.
Nrvr<00>r^r_r~) r<><00>sortedr_<00>original_cursor_positionr^<00>
splitlinesrxrr'rQr<>)rGrtr4r5rfr(<00>after<65>ls&& r3<00>join_selected_lines<65>Buffer.join_selected_lines1s<><00><00><14>#<23>#<23>#<23>#<23>#<23><1B> <11> !<21> !<21>4<EFBFBD>#7<>#7<>#P<>#P<> Q<>
<EFBFBD> <09><05><16><19><19>6<EFBFBD>E<EFBFBD>"<22><06><14> <09> <09>%<25>#<23>.<2E>.<2E>0<><05><14> <09> <09>"<22>#<23><0E><05>5:<3A>:<3A>E<EFBFBD>q<EFBFBD><18><18>#<23><1D><19>*<2A>*<2A>E<EFBFBD><05>:<3A>!<21><17>"<22>'<27>'<27>%<25>.<2E>(<28>5<EFBFBD>0<><1F><06><12><17><17><15>s<EFBFBD><02><1A>)<<3C> <<3C>=<3D><01>A<>
<EFBFBD><04> <0A><>;s<00> C<c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<>Is<00><00>
G<01>
G<01>t<EFBFBD>
Gr2c <0A><00>VPpV^8<>dtVPV^,
,pVPV^,
,pVPRV^,
V,V,VPVR,VnR#R#)z1
Swap the last two characters before the cursor.
N)r_r^)rG<00>posr/r0s& r3<00>swap_characters_before_cursor<6F>$Buffer.swap_characters_before_cursorIsn<00><00><13>"<22>"<22><03> <0E>!<21>8<EFBFBD><14> <09> <09>#<23><01>'<27>"<22>A<EFBFBD><14> <09> <09>#<23><01>'<27>"<22>A<EFBFBD><1C> <09> <09>)<29>C<EFBFBD>!<21>G<EFBFBD>,<2C>q<EFBFBD>0<>1<EFBFBD>4<>t<EFBFBD>y<EFBFBD>y<EFBFBD><13><14><EFBFBD>F<>D<EFBFBD>I<EFBFBD> r2c<01> <00>V^8<>dQhRRRR/#)r;rWrtr@rAr*)rBs"r3rCr<>Us<00><00>2<>2<>3<EFBFBD>2<>4<EFBFBD>2r2c <0A>~<00>V\VP48d#Wn\VP4VnR#R#)z!
Go to this item in the history.
N)rQr<>r<>r^r_rYs&&r3<00> go_to_history<72>Buffer.go_to_historyUs2<00><00> <11>3<EFBFBD>t<EFBFBD>*<2A>*<2A>+<2B> +<2B>!&<26> <1E>#&<26>t<EFBFBD>y<EFBFBD>y<EFBFBD>><3E>D<EFBFBD> <20> ,r2c<01>$<00>V^8<>dQhRRRRRR/#<00>r;r;rt<00>disable_wrap_aroundr<64>r@rAr*)rBs"r3rCr<>]s"<00><00>)<29>)<29>3<EFBFBD>)<29><14>)<29>RV<52>)r2c <0A>~<00>VP'd<>\VPP4pVPPf^pM]VPPV^,
8XdRpV'dR#M.\ V^,
VPPV,4pVP V4R#R#)zL
Browse to the next completions.
(Does nothing if there are no completion.)
N)r<>rQr=r><00>min<69>go_to_completion)rGr;r<><00>completions_countrWs&&& r3rc<00>Buffer.complete_next]s<><00><00> <10> <1E> <1E> <1E> #<23>D<EFBFBD>$7<>$7<>$C<>$C<> D<> <1D><13>"<22>"<22>1<>1<>9<><19><05><15>$<24>$<24>3<>3<>7H<37>1<EFBFBD>7L<37>L<><1C><05>&<26><1A>'<27><1C>%<25><01>)<29>4<EFBFBD>+><3E>+><3E>+M<>+M<>PU<50>+U<><12><05> <11> !<21> !<21>%<25> (<28> r2c<01>$<00>V^8<>dQhRRRRRR/#r<>r*)rBs"r3rCr<>ts$<00><00>)<29>)<29><18>)<29>37<33>)<29> <0A>)r2c <0A>l<00>VP'd<>VPP^8XdRpV'dR#MfVPPf(\VPP4^,
pM'\ ^VPPV,
4pVP V4R#R#)zP
Browse to the previous completions.
(Does nothing if there are no completion.)
N)r<>r>rQr=r<>r<>)rGr;r<>rWs&&& r3r[<00>Buffer.complete_previousts<><00><00> <10> <1E> <1E> <1E><13>"<22>"<22>1<>1<>Q<EFBFBD>6<><1C><05>&<26><1A>'<27><15>$<24>$<24>3<>3<>;<3B><1B>D<EFBFBD>/<2F>/<2F>;<3B>;<3B><<3C>q<EFBFBD>@<40><05><1B>A<EFBFBD>t<EFBFBD>2<>2<>A<>A<>E<EFBFBD>I<>J<><05> <10> !<21> !<21>%<25> (<28> r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<><00>s<00><00>'<27>'<27>4<EFBFBD>'r2c <0A>^<00>VP'dVPR4RVnR#R#)z2
Cancel completion, go back to the original text.
N)r<>r<>rRs&r3<00>cancel_completion<6F>Buffer.cancel_completion<6F>s+<00><00> <10> <1E> <1E> <1E> <10> !<21> !<21>$<24> '<27>"&<26>D<EFBFBD> <1F> r2c<01> <00>V^8<>dQhRRRR/#)r;r=zlist[Completion]r@r(r*)rBs"r3rCr<><00>s<00><00> #<23> #<23>,<<3C> #<23><1F> #r2c <0A><><00>\VPVR7VnVPP 4VP#)zp
Start completions. (Generate list of completions and initialize.)
By default, no completion will be selected.
)r<r=)r(r<>r<>r<>r)rGr=s&&r3<00>_set_completions<6E>Buffer._set_completions<6E>s:<00><00> .<2E>"<22>m<EFBFBD>m<EFBFBD><1B>
<EFBFBD><04><1B>
<0A>#<23>#<23>(<28>(<28>*<2A><13>"<22>"<22>"r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<><00>s<00><00>"!<21>"!<21><04>"!r2c
 <0A><><00>\4p.pVPPP4p\ VP
4F<>wrE\ VP R44F<>wrgVP4pV'gKVPV4'gK8Wq9gK@VPV4W@P8XdRV^,,pMRV^, RV^, 2pVP\V\V4)VR74K<> K<> VPVRRR1,R7VP^4R#) zR
Start a completion based on all the other lines in the document and the
history.
r$zCurrent, line %szHistory z, line )r^rb<00> display_metaN<61>r=r~)<10>setr<74><00>current_line_before_cursorrx<00> enumerater<65>r%<00>strip<69>
startswith<EFBFBD>addr<64>rrrQr<>r<>) rG<00>found_completionsr=<00> current_line<6E>i<>string<6E>jr<6A>r<>s & r3<00>start_history_lines_completion<6F>%Buffer.start_history_lines_completion<6F>s<00><00>
'*<2A>e<EFBFBD><19><18> <0B><1C>}<7D>}<7D>?<3F>?<3F>F<>F<>H<> <0C>"<22>4<EFBFBD>#6<>#6<>7<>I<EFBFBD>A<EFBFBD>!<21>&<26>,<2C>,<2C>t<EFBFBD>"4<>5<><04><01><15>G<EFBFBD>G<EFBFBD>I<EFBFBD><01><14>1<EFBFBD><11><1C><1C>l<EFBFBD>3<>3<><18>1<>)<29>-<2D>-<2D>a<EFBFBD>0<><1D> 2<> 2<>2<>+=<3D><11>Q<EFBFBD><15>+G<>L<EFBFBD>-5<>a<EFBFBD>!<21>e<EFBFBD>W<EFBFBD>G<EFBFBD>A<EFBFBD><01>E<EFBFBD>7<EFBFBD>+K<>L<EFBFBD>#<23>*<2A>*<2A>&<26>%&<26>03<30>L<EFBFBD>0A<30>/A<>-9<><1E><1A>6<>8<>, <0A><1D><1D>+<2B>d<EFBFBD><02>d<EFBFBD>*;<3B><1D><<3C> <0C><1D><1D>a<EFBFBD> r2c<01> <00>V^8<>dQhRRRR/#rVr*)rBs"r3rCr<><00>s<00><00>$<24>$<24>j<EFBFBD>$<24>T<EFBFBD>$r2c <0A><><00>VP'gQhVPpVPV4VP4wr4\W44VnW nR#)z;
Select a completion from the list of current completions.
N)r<>rZrirr<>)rGrW<00>statergrhs&& r3r<><00>Buffer.go_to_completion<6F>sX<00><00><14>"<22>"<22>"<22>"<22>"<22><15>#<23>#<23><05> <0A><19><19>%<25> <20>).<2E>(C<>(C<>(E<>%<25><08> <20><18>?<3F><04> <0A>$<24>r2c<01> <00>V^8<>dQhRRRR/#)r;<00>
completionrr@rAr*)rBs"r3rCr<><00>s<00><00> *<2A> *<2A>:<3A> *<2A>$<24> *r2c <0A><><00>VP'dVPR4RVnVPVP)4VP VP
4R#)z
Insert a given completion.
N)r<>r<>rlrb<00> insert_textr^)rGr<>s&&r3<00>apply_completion<6F>Buffer.apply_completion<6F>sQ<00><00>
<10> <1E> <1E> <1E> <10> !<21> !<21>$<24> '<27>"<22><04><1B> <0A>!<21>!<21>:<3A>#<<3C>#<<3C>"<<3C>=<3D> <0C><18><18><1A><1F><1F>)r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<><00>s<00><00> ,<2C> ,<2C>T<EFBFBD> ,r2c <0A><><00>VP4'd.VPfVPPVnR#R#RVnR#)za
Set `history_search_text`.
(The text before the cursor will be used for filtering the history.)
N)r<>r<>r<>r`rRs&r3<00>_set_history_search<63>Buffer._set_history_search<63>s@<00><00>
<10> %<25> %<25> '<27> '<27><13>'<27>'<27>/<2F>+/<2F>=<3D>=<3D>+K<>+K<><04>(<28>0<>(,<2C>D<EFBFBD> $r2c<01> <00>V^8<>dQhRRRR/#)r;r<>rtr@r<>r*)rBs"r3rCr<><00>s<00><00>
<EFBFBD>
<EFBFBD>#<23>
<EFBFBD>$<24>
r2c <0A><><00>VPRJ;'g-VPV,PVP4#)zn
True when the current entry matches the history search.
(when we don't have history search, it's also True.)
N)r<>r<>r<>)rGr<>s&&r3<00>_history_matches<65>Buffer._history_matches<65>sB<00><00>
<14>'<27>'<27>4<EFBFBD>/<2F>
<EFBFBD>
<EFBFBD>4<EFBFBD>3F<EFBFBD>3F<EFBFBD>q<EFBFBD>3I<EFBFBD>3T<EFBFBD>3T<EFBFBD> <10> $<24> $<24>4
<EFBFBD>
r2c<01> <00>V^8<>dQhRRRR/#r:r*)rBs"r3rCr<><00>s<00><00>M<01>M<01>S<EFBFBD>M<01><14>Mr2c <0A>~<00>VP4Rp\VP^,\VP44F4pVP V4'dW0nV^,pRpV^8XgK4M V'd;^VnV;P VPP4, unR#R#)zT
Move forwards through the history.
:param count: Amount of items to move forward.
FTN) r<><00>ranger<65>rQr<>r<>r_r<>r.<00>rGr;<00>found_somethingr<67>s&& r3re<00>Buffer.history_forward<72>s<><00><00> <0A> <20> <20>"<22> <20><0F><16>t<EFBFBD>)<29>)<29>A<EFBFBD>-<2D>s<EFBFBD>4<EFBFBD>3F<33>3F<33>/G<>H<>A<EFBFBD><13>$<24>$<24>Q<EFBFBD>'<27>'<27>%&<26>"<22><15><11>
<EFBFBD><05>"&<26><0F><14><01>z<EFBFBD><15> I<01> <1B>#$<24>D<EFBFBD> <20> <10> <20> <20>D<EFBFBD>M<EFBFBD>M<EFBFBD>$J<>$J<>$L<> L<> <20> r2c<01> <00>V^8<>dQhRRRR/#r:r*)rBs"r3rCr<>s<00><00>2<>2<>c<EFBFBD>2<>$<24>2r2c <0A><00>VP4Rp\VP^,
RR4F4pVPV4'dW0nV^,pRpV^8XgK4M V'd\ VP
4VnR#R#)z!
Move backwards through history.
FTNr~)r<>r<>r<>r<>rQr^r_r<>s&& r3r]<00>Buffer.history_backwards~<00><00> <0A> <20> <20>"<22> <20><0F><16>t<EFBFBD>)<29>)<29>A<EFBFBD>-<2D>r<EFBFBD>2<EFBFBD>6<>A<EFBFBD><13>$<24>$<24>Q<EFBFBD>'<27>'<27>%&<26>"<22><15><11>
<EFBFBD><05>"&<26><0F><14><01>z<EFBFBD><15> 7<> <1B>#&<26>t<EFBFBD>y<EFBFBD>y<EFBFBD>><3E>D<EFBFBD> <20> r2c<01>$<00>V^8<>dQhRRRRRR/#)r;rur?<00>_yank_last_argr<67>r@rAr*)rBs"r3rCr<>$s"<00><00>1(<28>1(<28>j<EFBFBD>1(<28><14>1(<28>RV<52>1(r2c <0A><00>Ve\V\4'gQhVPP4p\ V4'gR#VP
f\ V'dRM^R7pM VP
pVeWnVP^,
pV)\ V48<>dRpW5,p\PV4Uu.uFqwP4NK ppVUu.uFqw'gK VNK ppW<>P,p VP'd%VP\ VP44VPV 4W<>n WTnW@nR#uupiuupi \dRp Lti;i)aA
Pick nth word from previous history entry (depending on current
`yank_nth_arg_state`) and insert it at current position. Rotate through
history if called repeatedly. If no `n` has been given, take the first
argument. (The second word.)
:param n: (None or int), The index of the word from the previous line
to take.
N)rurr~)r<>rtr<><00> get_stringsrQr<>rqrurs<00>_QUOTED_WORDS_REr%r<>r&rvrlr<>)
rGrur<><00>history_stringsr<73><00>new_pos<6F>line<6E>w<>words<64>words
&&& r3<00> yank_nth_arg<72>Buffer.yank_nth_arg$sQ<00><00><11>y<EFBFBD>J<EFBFBD>q<EFBFBD>#<23>.<2E>.<2E>.<2E>.<2E><1E>,<2C>,<2C>2<>2<>4<><0F><12>?<3F>#<23>#<23> <12> <10> "<22> "<22> *<2A>#<23>N<EFBFBD>b<EFBFBD><01>B<>E<EFBFBD><18>+<2B>+<2B>E<EFBFBD> <0C>=<3D><17>G<EFBFBD><18>(<28>(<28>1<EFBFBD>,<2C><07> <13>8<EFBFBD>c<EFBFBD>/<2F>*<2A> *<2A><18>G<EFBFBD><1F>'<27><04>$4<>$:<3A>$:<3A>4<EFBFBD>$@<40>A<>$@<40>q<EFBFBD><17><17><19>$@<40><05>A<>!<21>'<27>E<EFBFBD>q<EFBFBD>Q<EFBFBD><11><11>E<EFBFBD><05>'<27> <16><18><17><17>><3E>D<EFBFBD>
<11> '<27> '<27> '<27> <10> %<25> %<25>c<EFBFBD>%<25>*F<>*F<>&G<> H<> <0C><18><18><14><1E>(,<2C>$<24>!(<28><1E>"'<27><1F><>!B<01><>'<27><><1A> <16><15>D<EFBFBD> <16>s$<00>
E,<04>( E1<04>6E1<04>?E6<00>6 F<03>Fc<01> <00>V^8<>dQhRRRR/#)r;rur?r@rAr*)rBs"r3rCr<>Ws<00><00>4<>4<>z<EFBFBD>4<>T<EFBFBD>4r2c <0A>,<00>VPVRR7R#)zX
Like `yank_nth_arg`, but if no argument has been given, yank the last
word by default.
T)rur<>N)r<>)rGrus&&r3<00> yank_last_arg<72>Buffer.yank_last_argWs<00><00>
<0A><19><19>A<EFBFBD>d<EFBFBD><19>3r2c<01> <00>V^8<>dQhRRRR/#)r;<00>selection_typer!r@rAr*)rBs"r3rCr<>^s <00><00>T<01>T<01>+<2B>T<01> <0A>Tr2c <0A><<00>\VPV4VnR#)zB
Take the current cursor position as the start of this selection.
N)r r_r<>)rGr<>s&&r3<00>start_selection<6F>Buffer.start_selection^s<00><00> .<2E>d<EFBFBD>.B<>.B<>N<EFBFBD>S<><04>r2c<01> <00>V^8<>dQhRRRR/#)r;<00>_cutr<74>r@rr*)rBs"r3rCr<>fs<00><00><1E><1E>4<EFBFBD><1E>M<EFBFBD>r2c <0A>h<00>VPP4wr#V'dW nRVnV#)a
Copy selected text and return :class:`.ClipboardData` instance.
Notice that this doesn't store the copied data on the clipboard yet.
You can store it like this:
.. code:: python
data = buffer.copy_selection()
get_app().clipboard.set_data(data)
N)r<><00> cut_selectionr<6E>)rGr<><00> new_document<6E>clipboard_datas&& r3<00>copy_selection<6F>Buffer.copy_selectionfs/<00><00>(,<2C>}<7D>}<7D>'B<>'B<>'D<>$<24> <0C> <0F>(<28>M<EFBFBD>#<23><04><1C><1D>r2c<01><00>V^8<>dQhRR/#)r;r@rr*)rBs"r3rCr<>ys<00><00>.<2E>.<2E>}<7D>.r2c <0A>&<00>VPRR7#)zC
Delete selected text and return :class:`.ClipboardData` instance.
T)r<>)r<>rRs&r3r<><00>Buffer.cut_selectionys<00><00><14>"<22>"<22><04>"<22>-<2D>-r2c<01>(<00>V^8<>dQhRRRRRRRR/#) r;<00>datar<00>
paste_moderr;rtr@rAr*)rBs"r3rCr<>s2<00><00>7<>7<><1B>7<><1E>7<><13> 7<>
<0E> 7r2c <0A>
<00>\V\4'gQhV\P\P\P
39gQhVP pVP PWVR7VnW@nR#)z%
Insert the data from the clipboard.
)r<>r;N) r<>rr<00> VI_BEFORE<52>VI_AFTER<45>EMACSr<53><00>paste_clipboard_datar<61>)rGr<>r<>r;r<s&&&& r3r<><00>Buffer.paste_clipboard_datasn<00><00><1A>$<24> <0A>.<2E>.<2E>.<2E>.<2E><19>i<EFBFBD>1<>1<>9<EFBFBD>3E<33>3E<33>y<EFBFBD><EFBFBD><EFBFBD>W<>W<>W<>W<> <20>M<EFBFBD>M<EFBFBD><19><1C> <0A> <0A>:<3A>:<3A> <10>u<EFBFBD>;<3B>
<EFBFBD><04> <0A> &7<>"r2c<01> <00>V^8<>dQhRRRR/#<00>r;<00> copy_marginr<6E>r@rAr*)rBs"r3rCr<><00>s<00><00>#<23>#<23>4<EFBFBD>#<23>4<EFBFBD>#r2c <0A><><00>V'd/VPRVPP,4R#VPR4R#)z/
Insert a line ending at the current position.
r$N)r<>r<><00>"leading_whitespace_in_current_line)rGr<>s&&r3<00>newline<6E>Buffer.newline<6E>s2<00><00> <17> <10> <1C> <1C>T<EFBFBD>D<EFBFBD>M<EFBFBD>M<EFBFBD>$T<>$T<>T<> U<> <10> <1C> <1C>T<EFBFBD> "r2c<01> <00>V^8<>dQhRRRR/#r<>r*)rBs"r3rCr<><00>s<00><00> "<22> "<22>T<EFBFBD> "<22>T<EFBFBD> "r2c <0A> <00>V'dVPPR,pMRpV;PVPP4, unVP V4V;P^,unR#)z*
Insert a new line above the current one.
r$N)r<>r<>r_r-r<><00>rGr<><00>inserts&& r3<00>insert_line_above<76>Buffer.insert_line_above<76>s]<00><00> <17><19>]<5D>]<5D>E<>E<><04>L<>F<EFBFBD><19>F<EFBFBD> <0C><1C><1C><04> <0A> <0A> H<> H<> J<>J<><1C> <0C><18><18><16> <20> <0C><1C><1C><01>!<21>r2c<01> <00>V^8<>dQhRRRR/#r<>r*)rBs"r3rCr<><00>s<00><00>
!<21>
!<21>T<EFBFBD>
!<21>T<EFBFBD>
!r2c <0A><><00>V'dRVPP,pMRpV;PVPP4, unVP V4R#)z*
Insert a new line below the current one.
r$N)r<>r<>r_r.r<>rs&& r3<00>insert_line_below<6F>Buffer.insert_line_below<6F>sL<00><00> <17><19>D<EFBFBD>M<EFBFBD>M<EFBFBD>L<>L<>L<>F<EFBFBD><19>F<EFBFBD> <0C><1C><1C><04> <0A> <0A> F<> F<> H<>H<><1C> <0C><18><18><16> r2c
<01>,<00>V^8<>dQhRRRRRRRRRR/#) r;r<>rL<00> overwriter<65><00> move_cursor<6F>
fire_eventr@rAr*)rBs"r3rCr<><00>sC<00><00>2J<01>2J<01><11>2J<01><18>2J<01><1A> 2J<01>
<19> 2J<01>
<0E> 2Jr2c <0A><><00>VPpVPpV'dVWVV\V4,pRV9dVRVPR4pVRVV,WV\V4,R,pMVRVV,WVR,pV'dVP\V4,p M VPp \ W<>4VnV'd<>VP P4VP'd>VP4'd(\4PVP44VP'd*\4PVP44R#R#R#)z<>
Insert characters at cursor position.
:param fire_event: Fire `on_text_insert` event. This is mainly used to
trigger autocompletion while typing.
r$N)r^r_rQ<00>findrr<>r<>rr<>r<>r r<>r<>r<>r<>)
rGr<>r r
r <00>otext<78>ocpos<6F>overwritten_textr^<00>cposs
&&&&& r3r<><00>Buffer.insert_text<78>s?<00><00><15> <09> <09><05><14>$<24>$<24><05> <15> %<25>U<EFBFBD>S<EFBFBD><14>Y<EFBFBD>-><3E>?<3F> <1C><13>'<27>'<27>#3<>4Q<34>6F<36>6K<36>6K<36>D<EFBFBD>6Q<36>#R<> <20><18><16>%<25>=<3D>4<EFBFBD>'<27>%<25><03><L<>8M<38>0M<30>0O<30>*P<>P<>D<EFBFBD><18><16>%<25>=<3D>4<EFBFBD>'<27>%<25><06>-<2D>7<>D<EFBFBD> <16><17>'<27>'<27>#<23>d<EFBFBD>)<29>3<>D<EFBFBD><17>'<27>'<27>D<EFBFBD> !<21><14>,<2C><04> <0A> <16> <10> <1F> <1F> $<24> $<24> &<26><14>~<7E>~<7E>~<7E>$<24>"<<3C>"<<3C>"><3E>"><3E><17> <09>0<>0<><14>1F<31>1F<31>1H<31>I<><14> <20> <20> <20><17> <09>0<>0<><14>1F<31>1F<31>1H<31>I<>!<21> r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<><00>s<00><00><16><16>d<EFBFBD>r2c <09><00>VP'dsVPP4wrWP8wgK@VPP VPVP
34\ WR7VnR#R#)<02>r_N)r<><00>popr^r<>rr_rr<><00>rGr^r<>s& r3<00>undo<64> Buffer.undo<64>si<00><00>
<13><1E><1E><1E><1C>(<28>(<28>,<2C>,<2C>.<2E>I<EFBFBD>D<EFBFBD><13>y<EFBFBD>y<EFBFBD> <20><14> <20> <20>'<27>'<27><14><19><19>D<EFBFBD>4H<34>4H<34>(I<>J<>!)<29><14> C<><04> <0A><15>r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<><00>s<00><00>@<01>@<01>d<EFBFBD>@r2c <09><><00>VP'dBVPRR7VPP4wr\WR7VnR#R#)F)rrN)r<>rrrr<>rs& r3<00>redo<64> Buffer.redo<64>sH<00><00> <0F> <1B> <1B> <1B> <10> #<23> #<23>U<EFBFBD> #<23> ;<3B><1D>(<28>(<28>,<2C>,<2C>.<2E>I<EFBFBD>D<EFBFBD>$<24>T<EFBFBD>?<3F>D<EFBFBD>M<EFBFBD> r2c<01> <00>V^8<>dQhRRRR/#)r;<00>
set_cursorr<EFBFBD>r@r*)rBs"r3rCr<>s<00><00><14><14>4<EFBFBD><14>D<EFBFBD>r2c <0A><00>VP\P8wdVP\P8H#VP'd'VPP VP 4\PVnRVnR# \dgpT'd9\\^TP4\TP44Tn
\PTnY nRp?R#Rp?ii;i)z^
Returns `True` if valid.
:param set_cursor: Set the cursor position, if an error was found.
NFT)r<>r5r8r6r<><00>validater<65>r$r<>r<>r_rQr^r7r<>)rGr<00>es&& r3r!<00>Buffer.validates<><00><00> <10> <20> <20>O<EFBFBD>$;<3B>$;<3B> ;<3B><17>(<28>(<28>O<EFBFBD>,A<>,A<>A<> A<> <10>><3E>><3E>><3E> <1D><14><0E><0E>'<27>'<27><04> <0A> <0A>6<>!0<> 5<> 5<><04><1D> $<24><04><1D><13><>#<23> <1D><1D>+.<2E><1B>A<EFBFBD>q<EFBFBD>0<>0<>1<>3<EFBFBD>t<EFBFBD>y<EFBFBD>y<EFBFBD>><3E>,<16>D<EFBFBD>(<28>)8<>(?<3F>(?<3F><04>%<25>()<29>%<25><1C><> <1D>s<00>%B<00> D<03>AC?<03>?Dc<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<>"s<00><00>(#<23>(#<23>t<EFBFBD>(#r2c<00> <0A><>"<00>VP\P8wdR#RpVPpVP'dBVPP VP4GRjx<01>L
VPV8wdK<>V'd\PVnM\PVnWn \4P4K<>Lj \ d pTpRp?LzRp?ii;i5i)a<>
Asynchronous version of `validate()`.
This one doesn't set the cursor position.
We have both variants, because a synchronous version is required.
Handling the ENTER key needs to be completely synchronous, otherwise
stuff like type-ahead is going to give very weird results. (People
could type input while the ENTER key is still processed.)
An asynchronous version is required if we have `validate_while_typing`
enabled.
N) r<>r5r8r<>r<><00>validate_asyncr$r7r6r<>r <00>
invalidate)rG<00>errorr<72>r"s& r3<00>_validate_async<6E>Buffer._validate_async"s<><00><00><00><13><14>$<24>$<24><0F>(?<3F>(?<3F>?<3F><16><19>E<EFBFBD><1B>}<7D>}<7D>H<EFBFBD><13>~<7E>~<7E>~<7E><1E><1E>.<2E>.<2E>7<>7<><04> <0A> <0A>F<>F<>F<>
<18>=<3D>=<3D>H<EFBFBD>,<2C><1C><15>(7<>(?<3F>(?<3F><04>%<25>(7<>(=<3D>(=<3D><04>%<25>$)<29> !<21> <13>I<EFBFBD> <20> <20> "<22>G<01><>&<26><1E><1D>E<EFBFBD><45><1E>sI<00>AC5<01>(C<00>.C<04>/C<00>3C5<01>A C5<01>C<00> C2<03>&C-<03>(C5<01>-C2<03>2C5c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<>Ls<00><00> 6<> 6<>4<EFBFBD> 6r2c <0A><00>VP'dmVPP4p\V4'dVR,VP8wd(VPP VP4R#R#R#)z*
Append the current input to the history.
Nr~)r^r<>r<>rQ<00> append_string)rGr<>s& r3r<><00>Buffer.append_to_historyLs[<00><00> <10>9<EFBFBD>9<EFBFBD>9<EFBFBD>"<22>l<EFBFBD>l<EFBFBD>6<>6<>8<>O<EFBFBD><16><EFBFBD>'<27>'<27>?<3F>2<EFBFBD>+><3E>$<24>)<29>)<29>+K<><14> <0C> <0C>*<2A>*<2A>4<EFBFBD>9<EFBFBD>9<EFBFBD>5<>,L<01> r2c<01>(<00>V^8<>dQhRRRRRRRR/#) r;<00> search_stater<00>include_current_positionr<6E>r;rtr@ztuple[int, int] | Noner*)rBs"r3rCr<>Ws8<00><00>V9<>V9<>!<21>V9<>#'<27>V9<><13> V9<>
<20> V9r2c <0A>aaa a
a <0B>V^8<>gQhVPo VPo VP4o
RV V
VVV 3RllpSPpSPp\ V4FpV!WV4pVfR#VwrVK WVP 3#)z<>
Execute search. Return (working_index, cursor_position) tuple when this
search is applied. Returns `None` when this text cannot be found.
c<01>$<00>V^8<>dQhRRRRRR/#)r;r<>rtr<>rr@ztuple[int, Document] | Noner*)rBs"r3rC<00>$Buffer._search.<locals>.__annotate__gs$<00><00>: <18>: <18><1E>: <18>*2<>: <18> (<28>: r2c<05><><<05>S\P8Xd<>VPSSSR7pVe*V\VPVP
V,43#\ V^,\SP4^,4FnpV\SP4,p\SPV,^4pVPSRSR7pVfKVV\VPV43u# R#VPSSR7pVe*V\VPVP
V,43#\ V^,
RR4F<>pV\SP4,p\SPV,\SPV,44pVPSSR7pVfKoV\VP\VP4V,43u# R#)z@
Do search one time.
Return (working_index, document) or `None`
)r1<00> ignore_caseNT)r6<00><><EFBFBD><EFBFBD><EFBFBD>r~)
r<00>FORWARDr rr^r_r<>rQr<><00>find_backwards) r<>r<><00> new_indexr<78><00> directionr6r1rGr^s && <20><><EFBFBD><EFBFBD><EFBFBD>r3<00> search_once<63>#Buffer._search.<locals>.search_oncegs<><00><><00><19>O<EFBFBD>3<>3<>3<>$<24>M<EFBFBD>M<EFBFBD><18>-E<> +<2B>*<2A><12> <09> <1D>(<28>%<25> <20><18><1D><1D><08>0H<30>0H<30>9<EFBFBD>0T<30>U<><16><16>#<23>=<3D>1<EFBFBD>#4<>c<EFBFBD>$<24>:M<>:M<>6N<36>QR<51>6R<36>S<><01><19>S<EFBFBD><14>!4<>!4<>5<>5<><01>#+<2B>D<EFBFBD>,?<3F>,?<3F><01>,B<>A<EFBFBD>#F<><08>$,<2C>M<EFBFBD>M<EFBFBD> <20>4<EFBFBD>[<5B>%2<>%<1A> <09>%<25>0<>$%<25>x<EFBFBD><08> <0A> <0A>y<EFBFBD>'I<>#J<>J<>T<01>D<18>/%<25>3<>3<>D<EFBFBD>k<EFBFBD>3<>R<> <09><1C>(<28>%<25> <20><18><1D><1D><08>0H<30>0H<30>9<EFBFBD>0T<30>U<><16><16> #<23>=<3D>1<EFBFBD>#4<>b<EFBFBD>"<22>=<3D><01><19>S<EFBFBD><14>!4<>!4<>5<>5<><01>#+<2B> <20>/<2F>/<2F><01>2<>C<EFBFBD><04>8K<38>8K<38>A<EFBFBD>8N<38>4O<34>$<1A><08>%-<2D>$;<3B>$;<3B> <20>k<EFBFBD>%<<3C>%<1A> <09>%<25>0<> !<21> (<28><18><1D><1D><03>H<EFBFBD>M<EFBFBD>M<EFBFBD>8J<38>Y<EFBFBD>8V<38> W<>$<1E><1E>><3E>r2N)r^r;r6r<>r<>r<>r_) rGr0r1r;r<r<>r<><00>_r<5F>r;r6r^s f&f& @@@r3<00>_search<63>Buffer._searchWs<><00><><00><15>q<EFBFBD>y<EFBFBD><18>y<EFBFBD><1B> <20> <20><04> <20>*<2A>*<2A> <09>"<22>.<2E>.<2E>0<> <0B>: <18>: <18>z<1D>*<2A>*<2A> <0A><17>=<3D>=<3D><08><16>u<EFBFBD><1C>A<EFBFBD> <20><1D>9<>F<EFBFBD><15>~<7E><1B>*0<>'<27> <0A>x<EFBFBD> <1E><1E>7<>7<>8<>8r2c<01> <00>V^8<>dQhRRRR/#)r;r0rr@rr*)rBs"r3rCr<><00>s<00><00><0E><0E> <0B><0E><08>r2c <0A><><00>VPVRR7pVf VP#Vwr4W0P8XdVPpMRp\ VP
V,WER7#)z<>
Return a :class:`~prompt_toolkit.document.Document` instance that has
the text/cursor position for this search, if we would apply it. This
will be used in the
:class:`~prompt_toolkit.layout.BufferControl` to display feedback while
searching.
T)r1N)<01> selection)r?r<>r<>r<>rr<>)rGr0<00> search_resultr<74>r_rCs&& r3<00>document_for_search<63>Buffer.document_for_search<63>si<00><00><1D> <0C> <0C>\<5C>D<EFBFBD> <0C>Q<> <0A> <18> <20><17>=<3D>=<3D> <20>-:<3A> *<2A>M<EFBFBD><1D> 2<> 2<>2<> <20>0<>0<> <09> <20> <09><1B><14>#<23>#<23>M<EFBFBD>2<>O<EFBFBD><0E> r2c<01>(<00>V^8<>dQhRRRRRRRR/#)r;r0rr1r<>r;rtr@r*)rBs"r3rCr<><00>s2<00><00>#<23>#<23>!<21>#<23>#'<27>#<23><13> #<23>
<0A> #r2c <0A>T<00>VPWVR7pVf VP#VwrVV#)z<>
Get the cursor position for this search.
(This operation won't change the `working_index`. It's won't go through
the history. Vi text objects can't span multiple items.)
<EFBFBD>r1r;)r?r_<00>rGr0r1r;rDr<>r_s&&&& r3<00>get_search_position<6F>Buffer.get_search_position<6F>s?<00><00><1D> <0C> <0C> <18>SX<53>%<25>
<EFBFBD> <0A> <19> <20><17>'<27>'<27> '<27>-:<3A> *<2A>M<EFBFBD>"<22> "r2c<01>(<00>V^8<>dQhRRRRRRRR/#) r;r0rr1r<>r;rtr@rAr*)rBs"r3rCr<><00>s2<00><00>3<>3<>!<21>3<>#'<27>3<><13> 3<>
<0E> 3r2c <0A>X<00>VPWVR7pVeVwrVWPnW`nR#R#)zQ
Apply search. If something is found, set `working_index` and
`cursor_position`.
rIN)r?r<>r_rJs&&&& r3<00> apply_search<63>Buffer.apply_search<63>s><00><00><1D> <0C> <0C> <18>SX<53>%<25>
<EFBFBD> <0A> <19> $<24>-:<3A> *<2A>M<EFBFBD>!.<2E> <1E>#2<> <20> %r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<><00>s<00><00>$<24>$<24><04>$r2c <09><00>RVnR#rF)r<>rRs&r3<00>exit_selection<6F>Buffer.exit_selection<6F>s
<00><00>#<23><04>r2c<01><00>V^8<>dQhRR/#<00>r;r@ztuple[str, Callable[[], None]]r*)rBs"r3rCr<><00>s<00><00>!<21>!<21>)G<>!r2c <0A>a<04>\VP4p\P!V4wpo\P
!W P PR44\P!V4RV3RllpSV3#)zI
Simple (file) tempfile implementation.
Return (tempfile, cleanup_func).
<EFBFBD>utf-8c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rC<00>4Buffer._editor_simple_tempfile.<locals>.__annotate__<5F>s<00><00> <20> <20><14> r2c<01>4<<01>\P!S4R#rF)<02>os<6F>unlink)<01>filenames<00>r3<00>cleanup<75>/Buffer._editor_simple_tempfile.<locals>.cleanup<75>s<00><><00> <0E>I<EFBFBD>I<EFBFBD>h<EFBFBD> r2) r#r<>r<><00>mkstempr\<00>writer^<00>encode<64>close)rG<00>suffix<69>
descriptorr_r^s& @r3<00>_editor_simple_tempfile<6C>Buffer._editor_simple_tempfile<6C>sh<00><><00>
<18><04>,<2C>,<2C>-<2D><06>'<27>/<2F>/<2F><06>7<><1C>
<EFBFBD>H<EFBFBD>
<EFBFBD><08><08><1A>Y<EFBFBD>Y<EFBFBD>-<2D>-<2D>g<EFBFBD>6<>7<>
<EFBFBD><08><08><1A><1C> <20> <20><18><17> <20> r2c<01><00>V^8<>dQhRR/#rVr*)rBs"r3rCr<>s<00><00>!<21>!<21>*H<>!r2c <09><>a<07>\VP4pV'gVP4#\V4p\P
P V4wr#\P
PV4'd
VR,p\P!4oV'd!\P
PSV4o\P!S4\P
PSV4p\VRRR7;_uu_4pVPVP4RRR4RV3RllpWF3# +'giL;i):<3A>NNr<4E>rX)<01>encodingNc<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rC<00>5Buffer._editor_complex_tempfile.<locals>.__annotate__s<00><00> #<23> #<23><14> #r2c<01>4<<01>\P!S4R#rF)<02>shutil<69>rmtree)<01>dirpaths<00>r3r_<00>0Buffer._editor_complex_tempfile.<locals>.cleanups<00><><00> <12>M<EFBFBD>M<EFBFBD>'<27> "r2)r#r<>rgrLr\<00>pathr%<00>isabs<62>mkdtempr'<00>makedirs<72>openrbr^)rG<00>headtail<69>head<61>tailr^<00>fhr_rrs& @r3<00>_editor_complex_tempfile<6C>Buffer._editor_complex_tempfiles<><00><><00><19>$<24>-<2D>-<2D>(<28><08><17><17>/<2F>/<2F>1<> 1<><16>x<EFBFBD>=<3D><08><18>W<EFBFBD>W<EFBFBD>]<5D>]<5D>8<EFBFBD>,<2C>
<EFBFBD><04> <0A>7<EFBFBD>7<EFBFBD>=<3D>=<3D><14> <1E> <1E><17><02>8<EFBFBD>D<EFBFBD><1A>"<22>"<22>$<24><07> <0F><18>g<EFBFBD>g<EFBFBD>l<EFBFBD>l<EFBFBD>7<EFBFBD>D<EFBFBD>1<>G<EFBFBD>
<EFBFBD> <0B> <0B>G<EFBFBD><1C><16>7<EFBFBD>7<EFBFBD><<3C><<3C><07><14>.<2E><08> <11>(<28>C<EFBFBD>'<27> 2<> 2<>b<EFBFBD> <0E>H<EFBFBD>H<EFBFBD>T<EFBFBD>Y<EFBFBD>Y<EFBFBD> <1F>3<> #<23> #<23><18> <20> <20> 3<> 2<>s <00>E<05> E c<01> <00>V^8<>dQhRRRR/#)r;<00>validate_and_handler<65>r@zasyncio.Task[None]r*)rBs"r3rCr<> s<00><00>-7<>-7<>$<24>-7<>CU<43>-7r2c <0A>aaaa<04>SP4'd \4hSP'dSP4wooMSP 4wooRVVVV3Rllp\ 4P V!44#)zM
Open code in editor.
This returns a future, and runs in a thread executor.
c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rC<00>+Buffer.open_in_editor.<locals>.__annotate__/s<00><00> <1F> <1F>4<EFBFBD> r2c<00><01><><"<00>\VV3RlRR7GRjx<01>L
pV'd<>\SR4;_uu_4pVP4PR4pVP R4'dVRRp\ V\ V4R7SnRRR4S'dSP4S!4R#L<> +'giL3;i S!4i;i5i) c<01>&<<02>SPS4#rF)<01>_open_file_in_editor)r^rGs<00><>r3<00><lambda><3E>4Buffer.open_in_editor.<locals>.run.<locals>.<lambda>6s<00><><00>D<EFBFBD>5<>5<>h<EFBFBD>?r2T)<01> in_executorN<72>rbrXr$r}r~) r rx<00>read<61>decode<64>endswithrrQr<>r<>)<07>successr<73>r^<00> cleanup_funcr^rGr<>s <20><><EFBFBD><EFBFBD>r3<00>run<75>"Buffer.open_in_editor.<locals>.run/s<><00><><00><00> <1F>
!0<>?<3F>T<EFBFBD>!<12><12><07>
<1B><1D>h<EFBFBD><04>-<2D>-<2D><11> <20>v<EFBFBD>v<EFBFBD>x<EFBFBD><EFBFBD><EFBFBD>w<EFBFBD>7<><04> <20>=<3D>=<3D><14>.<2E>.<2E>#'<27><03><12>9<EFBFBD>D<EFBFBD>(0<>d<EFBFBD>C<EFBFBD>PT<50>I<EFBFBD>(V<><04> <0A>.<2E>+<2B><1C>0<>0<>2<><1D><0E>-<12> .<2E>-<2D><> <1D><0E>sO<00>C<01>C<00>B;<04> C<00>C<00>AB=<05>C<00>"C<00>2 C<01>;C<00>= C <09>C<00> C<03>C)r<>r&r<>r}rgr r<>)rGr<>r<>r<>r^sff @@r3<00>open_in_editor<6F>Buffer.open_in_editor sm<00><><00> <10>><3E>><3E> <1B> <1B>$<24>&<26> &<26> <10>=<3D>=<3D>=<3D>%)<29>%B<>%B<>%D<> "<22>H<EFBFBD>l<EFBFBD>%)<29>%A<>%A<>%C<> "<22>H<EFBFBD>l<EFBFBD> <1F> <1F><<17>y<EFBFBD>/<2F>/<2F><03><05>6<>6r2c<01> <00>V^8<>dQhRRRR/#)r;r^rLr@r<>r*)rBs"r3rCr<>Os<00><00>"<15>"<15>S<EFBFBD>"<15>T<EFBFBD>"r2c <0A>N<00>\PPR4p\PPR4pVVRRRRR.pVFEpV'gK \P!\
P !V4V.,4pV^8Hu# R# \dKYi;i) zK
Call editor executable.
Return True when we received a zero return code.
<EFBFBD>VISUAL<41>EDITORz/usr/bin/editorz /usr/bin/nanoz /usr/bin/picoz /usr/bin/viz/usr/bin/emacsF)r\<00>environ<6F>get<65>
subprocess<EFBFBD>call<6C>shlexr%<00>OSError)rGr^<00>visual<61>editor<6F>editorsr"<00>
returncodes&& r3r<><00>Buffer._open_file_in_editorOs<><00><00><14><1A><1A><1E><1E><08>)<29><06><13><1A><1A><1E><1E><08>)<29><06> <13> <12> <1D> <1B> <1B> <19> <1C> 
<EFBFBD><07><19>A<EFBFBD><10>q<EFBFBD><19>",<2C><1F><1F><15><1B><1B>Q<EFBFBD><1E>8<EFBFBD>*<2A>1L<31>!M<>J<EFBFBD>%<25><11>?<3F>*<2A> <19><15><> <1F><19><18><19>s<00>6B<02> B$<05>#B$c
<01>,<00>V^8<>dQhRRRRRRRRRR/#<00> r;<00> select_firstr<74><00> select_last<73>insert_common_part<72>complete_eventzCompleteEvent | Noner@rAr*)rBs"r3rCr<>ss<<00><00>
<EFBFBD>
<EFBFBD><1A>
<EFBFBD><1A>
<EFBFBD>!<21> 
<EFBFBD>
-<2D> 
<EFBFBD>
<0E> 
r2c  <0A><><00>W,V,^8:gQh\4PTPTTTT;'g \RR7R74R#)zz
Start asynchronous autocompletion of this buffer.
(This will do nothing if a previous completion was still in progress.)
T)<01>completion_requested)r<>r<>r<>r<>N)r r<>r<>r)rGr<>r<>r<>r<>s&&&&&r3<00>start_completion<6F>Buffer.start_completionss\<00><00><1C>)<29>,><3E>><3E>!<21>C<>C<>C<><0F> <09>(<28>(<28> <10> !<21> !<21>)<29>'<27>#5<>-<2D> <<3C> <<3C> <20>d<EFBFBD>;<3B> "<22> <0E>
r2c<01><00>V^8<>dQhRR/#)r;r@z(Callable[..., Coroutine[Any, Any, None]]r*)rBs"r3rCr<><00>s<00><00>`<1F>`<1F>-U<>`r2c <0A>@aa<02>RRlo\RRVV3Rlll4pV#)z<>
Create function for asynchronous autocompletion.
(This consumes the asynchronous completer generator, which possibly
runs the completion algorithm in another thread.)
c<01>$<00>V^8<>dQhRRRRRR/#)r;r<>rr<>rr@r<>r*)rBs"r3rC<00>8Buffer._create_completer_coroutine.<locals>.__annotate__<5F>s"<00><00> 4<> 4<>h<EFBFBD> 4<>J<EFBFBD> 4<>SW<53> 4r2c<05>t<00>VPpV\V4VP,RpW1P8H#)zj
Return `True` if applying this completion doesn't have any effect.
(When it doesn't insert any new text.
N)r`rQrbr^)r<>r<>r`<00> replaced_texts&& r3<00>completion_does_nothing<6E>CBuffer._create_completer_coroutine.<locals>.completion_does_nothing<6E>s@<00><00>
"*<2A>!<<3C>!<<3C> <1E>.<2E><13>&<26>'<27>*<2A>*C<>*C<>C<>E<><0E>M<EFBFBD>!<21>O<EFBFBD>O<EFBFBD>3<> 3r2c
<01>,<00>V^8<>dQhRRRRRRRRRR/#r<>r*)rBs"r3rCr<><00>sA<00><00>J !<21>J !<21><1E>J !<21><1D>J !<21>!%<25>J !<21>1<> J !<21>
<12> J !r2c<00><01><><a a"<00>SPpT;'g \RR7pSP'gSP'gR#\ SPR7o S SnRV V3Rllp\
P !4oRVV3Rllp\
P!V!44p\SPPWC44;_uu_4GRjx<01>L
pVRjx<01>L
p S PPV 4SP4V!4'gM'\S P4SP8<>gKjRRR4GRjx<01>L
VP4SP P#4S Pp
\V
4^8XdS!WJ^,4'dV
RV!4'EdKSP'dSPP$eR#V
'g$RSnSP P#4R#V'dSP'^4R#V'd$SP'\V
4^,
4R#V'd<>\)WJ4p V 'dlSP+V 4\V
4^8<>dBV
U u.uFp V P-\V 44NK up V
R&SP/V
R 7R#RSnR#\V
4^8XdSP'^4R#R#R#SPP0VP08XdR#SPP0P3VP04'd\4hR#EL<>EL<>ED<>EL4EL) +GRjx<01>L
'giELA;i TP4SP P#4i;iuup i5i)
T)<01> text_insertedN)r<c<01><00>V^8<>dQhRR/#rr*)rBs"r3rC<00>QBuffer._create_completer_coroutine.<locals>.async_completer.<locals>.__annotate__<5F>s<00><00> =<3D> =<3D>T<EFBFBD> =r2c<05>"<<02>SPS8H#)zYKeep retrieving completions. Input text has not yet changed
while generating completions.)r<>)r<>rGs<00><>r3<00>proceed<65>LBuffer._create_completer_coroutine.<locals>.async_completer.<locals>.proceed<65>s<00><><00><1C>*<2A>*<2A>n<EFBFBD><<3C><r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<><00>s<00><00> 0<> 0<><14> 0r2c<00><05><><"<00>SPP4SP4\P!R4GRjx<01>L
SP 4GRjx<01>L
KcLL5i)aeBackground loop to refresh the UI at most 3 times a second
while the completion are loading. Calling
`on_completions_changed.fire()` for every completion that we
receive is too expensive when there are many completions. (We
could tune `Application.max_render_postpone_time` and
`Application.min_redraw_interval`, but having this here is a
better approach.)
g333333<EFBFBD>?N)r<>r<00>clearr<72><00>sleep<65>wait)<02>refresh_neededrGs<00><>r3<00>refresh_while_loading<6E>ZBuffer._create_completer_coroutine.<locals>.async_completer.<locals>.refresh_while_loading<6E>sU<00><><00><00><1B><18>/<2F>/<2F>4<>4<>6<>"<22>(<28>(<28>*<2A>!<21>-<2D>-<2D><03>,<2C>,<2C>,<2C>(<28>-<2D>-<2D>/<2F>/<2F>/<2F>-<2D>/<2F>s$<00>AA+<01>A'<04> A+<01> A)<04>!A+<01>)A+:NNNr<4E>)r<>rr<>r<>r(r<>r"<00> ensure_futurer<00>get_completions_asyncr=rr<>rQr<>r<>r<>rr>r<>rr<><00>new_completion_from_positionr<6E>r`r<><00>_Retry)r<>r<>r<>r<>r<>r<>r<><00> refresh_task<73>async_generatorr<72>r=<00> common_partrer<>r<>r<>rGs&&&& @@<40><>r3<00>async_completer<65>;Buffer._create_completer_coroutine.<locals>.async_completer<65>s/<00><><00><00><1C>}<7D>}<7D>H<EFBFBD>+<2B>P<>P<>}<7D>4<EFBFBD>/P<>N<EFBFBD><14>"<22>"<22>"<22>$<24>.<2E>.<2E>.<2E><16>-<2D>t<EFBFBD>}<7D>}<7D>M<>N<EFBFBD>"0<>D<EFBFBD> <1F> =<3D> =<3D>
%<25>]<5D>]<5D>_<EFBFBD>N<EFBFBD> 0<> 0<>#<23>0<>0<>1F<31>1H<31>I<>L<EFBFBD> 3<>#<23><18>N<EFBFBD>N<EFBFBD>8<>8<><18>R<><12><12><12>$<24>,;<3B> "<22> "<22>j<EFBFBD>&<26>2<>2<>9<>9<>*<2A>E<>&<26>*<2A>*<2A>,<2C> '<27>y<EFBFBD>y<EFBFBD>!<21> <20><0E> :<3A> :<3A>;<3B>#<23>=<3D>=<3D>><3E>"<22>!<12><12>$<1D>#<23>#<23>%<25><15>+<2B>+<2B>0<>0<>2<>(<28>4<>4<>K<EFBFBD><13>;<3B><1F>1<EFBFBD>$<24>)@<40><18>a<EFBFBD>.<2E>*<0E>*<0E> <20><01>N<EFBFBD><17>y<EFBFBD>y<EFBFBD><1D>+<2B>+<2B>+<2B><1B>*<2A>*<2A>9<>9<>E<><1A>#<23>*.<2E>D<EFBFBD>'<27><19>/<2F>/<2F>4<>4<>6<><1A>  <20><18>)<29>)<29>!<21>,<2C> <20><18>)<29>)<29>#<23>k<EFBFBD>*:<3A>Q<EFBFBD>*><3E>?<3F>'<27>"<<3C>X<EFBFBD>"S<>K<EFBFBD>"<22><1C>(<28>(<28><1B>5<><1E>{<7B>+<2B>a<EFBFBD>/<2F> *5<>.<1E>)4<>A<EFBFBD>!"<22> ><3E> ><3E>s<EFBFBD>;<3B>?O<> P<>)4<>.<1E>K<EFBFBD><01>N<EFBFBD>
!<21>1<>1<>k<EFBFBD>1<>J<>26<32>D<EFBFBD>/<2F><1F>{<7B>+<2B>q<EFBFBD>0<> <20>1<>1<>!<21>4<>1<>1(<28>><18>=<3D>=<3D>3<>3<>x<EFBFBD>7R<37>7R<37>R<><1A><17>=<3D>=<3D>3<>3<>><3E>><3E><1C>/<2F>/<2F><12><12>!<21>L<EFBFBD><12>{<12> "<22>O<EFBFBD><12><12><12><12><>$<1D>#<23>#<23>%<25><15>+<2B>+<2B>0<>0<>2<><32>^.<1E>s<EFBFBD><00>4O<01>O<01> A#O<01>00N&<00> M<<08>!N&<00>$N <05>'N<06>+M?
<EFBFBD>,N<06>/AN <05>N <05> N&<00>N<04>N&<00>"A+O<01>O<01> !O<01>*O<01>-O<01>*O<01>38O<01>+#O<04>B%O<01>4O<01><N&<00>?N<06>N <05>N&<00> N# <09>N<0E>
N# <09>N# <09> N&<00>&,O<03>O<01>FFFN<46><01>_only_one_at_a_time)rGr<>r<>sf @r3r<><00>"Buffer._create_completer_coroutine<6E>s-<00><><00> 4<>
<1D>J !<21>J !<21>
<1D>J !<21>X<1F>r2c<01><00>V^8<>dQhRR/#<00>r;r@z'Callable[[], Coroutine[Any, Any, None]]r*)rBs"r3rCr<>-s<00><00><1F><1F>0W<30>r2c <0A>,a<00>\RV3Rll4pV#)zT
Create function for asynchronous auto suggestion.
(This can be in another thread.)
c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rC<00>;Buffer._create_auto_suggest_coroutine.<locals>.__annotate__4s<00><00> <1D> <1D>t<EFBFBD> r2c<00><01>0<"<00>SPpSP'gSP'gR#SPPSV4GRjx<01>L
pSPV8Xd$VSnSPP 4R#\ hL>5irF)r<>r<>r<><00>get_suggestion_asyncr<63>rr<>)r<>r<>rGs <20>r3<00>async_suggestor<6F>>Buffer._create_auto_suggest_coroutine.<locals>.async_suggestor3sw<00><><00><00><1B>}<7D>}<7D>H<EFBFBD><14><EFBFBD><EFBFBD><EFBFBD>d<EFBFBD>&7<>&7<>&7<><16>#<23>0<>0<>E<>E<>d<EFBFBD>H<EFBFBD>U<>U<>J<EFBFBD><14>}<7D>}<7D><08>(<28>",<2C><04><0F><14>&<26>&<26>+<2B>+<2B>-<2D><1D> <0C>V<01>s<00>0B<01>!B<01>B<04>?Br<>)rGr<>sf r3r<><00>%Buffer._create_auto_suggest_coroutine-s<00><><00>
<1D> <1D>
<1D> <1D>$<1F>r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<>Hs<00><00> <1F> <1F> 0<> r2c <0A>,a<00>\RV3Rll4pV#)z^
Create a function for asynchronous validation while typing.
(This can be in another thread.)
c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rC<00><Buffer._create_auto_validate_coroutine.<locals>.__annotate__Qs<00><00> )<29> )<29>t<EFBFBD> )r2c<00><01>D<"<00>SP4GRjx<01>L
R#L5irF)r)rRs<00>r3<00>async_validator<6F>?Buffer._create_auto_validate_coroutine.<locals>.async_validatorPs<00><><00><00><16>&<26>&<26>(<28> (<28> (<28>s <00> <01><04> r<>)rGr<>sf r3r<><00>&Buffer._create_auto_validate_coroutineHs<00><><00>
<1D> )<29>
<1D> )<29><1F>r2c<01><00>V^8<>dQhRR/#r<>r*)rBs"r3rCr<>Vs<00><00><1D><1D>T<EFBFBD>r2c <0A><><00>VPRR7pV'dSVP'dVPV4pMRpVP4V'gVP4R#R#R#)z/
Validate buffer and handle the accept action.
T)rFN)r!r<>r<>r<>)rG<00>valid<69> keep_texts& r3r<><00>Buffer.validate_and_handleVs\<00><00><15> <0A> <0A><14> <0A>.<2E><05> <11><13>"<22>"<22>"<22> <20>/<2F>/<2F><04>5<> <09>!<21> <09> <10> "<22> "<22> $<24><1C><14>
<EFBFBD>
<EFBFBD> <0C><1D> r2),<2C>__cursor_position<6F>__working_indexr<78>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r_r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r^r<>r<>r<>r<>r<>r<>r<>)NNNNrrrFFFNNFTi'NNNNN)NF)F)T<>rk)rkF)rvrF)FTT)Frk)Trkr<>)Rr,r-r.r/r0rHrSr<>r<>r<>r<>ror^<00>setterr_r<>r<>r<>r<>r rrr)r1r7rArFrOrTr_rfrlrpryr<>r<>r<>rcr[r<>r<>r<>r<>r<>r<>r<>rer]r<>r<>r!<00>
CHARACTERSr<EFBFBD>r<>r<>rr<>r<>r<>rrr<>rrr!r)r<>r?rErKrOrSrgr}r<>r<>r<>r<>r<>r<>r<>r1r*r2r3r'r'<00>sM<00><00>9<08>vO&<26>bN<01>?!<21>B3I<01>n<15>(;<3B><0E>7<><0E>7<>
<EFBFBD>[<5B>[<5B>,<2C><11>,<2C>2<0E>&<26><0E>&<26><15><1B><1B>,<2C><1C>,<2C>"<0E>$<24><0E>$<24><13><19><19>!<21><1A>!<21>F<01>(/<2F>$<0E>
<EFBFBD><0E>
<EFBFBD><0E>_<EFBFBD>_<EFBFBD>!<21><15>!<21>!,<2C>F<0E>)<29><0E>)<29>"<22>  <20>@ 
<EFBFBD>
<EFBFBD>*T<01>U<01>0<>0<>S<01>$S<01>$<17>, <16><0E> 
<EFBFBD>0
G<01>2<>)<29>.)<29>,'<27> #<23>"!<21>H$<24>" *<2A> ,<2C>
<EFBFBD>M<01>02<>*1(<28>f4<>/<<3C>.F<>.F<>T<01><1E>&.<2E>!*<2A><0F><0F><16> 7<>*#<23> "<22>
!<21>2J<01>h<16> @<01><14>>(#<23>T 6<>V9<>p<0E>2#<23>*3<>&$<24>!<21> !<21>:-7<>^"<15>H
<EFBFBD>0`<1F>D<1F>6 <1F><1D>r2<00>_T.)<01>boundc<01> <00>V^8<>dQhRRRR/#)r;<00> coroutiner<65>r@r*)rBs"r3rCrCls<00><00>#<23>#<23>2<EFBFBD>#<23>"<22>#r2c<05>Zaa<02>Ro\S4RVV3Rll4p\\V4#)z<>
Decorator that only starts the coroutine only if the previous call has
finished. (Used to make sure that we have only one autocompleter, auto
suggestor and validator running at a time.)
When the coroutine raises `_Retry`, it is restarted.
Fc<01>$<00>V^8<>dQhRRRRRR/#)r;r/r<00>kwr@r*)rBs"r3rC<00>)_only_one_at_a_time.<locals>.__annotate__ws!<00><00><1C><1C><03><1C>3<EFBFBD><1C>3<EFBFBD>r2c<00><01><><"<00>S'dR#RoS!V/VBGRjx<01>L
RoR#L \dK'i;i Roi;i5i)NTF)r<>)r/r<>r<><00>runnings*,<2C><>r3<00> new_coroutine<6E>*_only_one_at_a_time.<locals>.new_coroutinevs[<00><><00><00>
<13> <12><16><07> <1C><16> <20>#<23>Q<EFBFBD>-<2D>"<22>-<2D>-<2D>-<2D> <20><1B>G<EFBFBD> .<2E><><1D><1D><1C><1D><>
<1C>G<EFBFBD>s9<00> A<01><<00> *<00>(<04>*<00>A<01>*<00> 9<03><<00>9<03><<00>A<03>A)rr r<>)r<>r<>r<>sf @r3r<>r<>ls5<00><><00><14>G<EFBFBD>
<EFBFBD>9<EFBFBD><15><1C><1C><16><1C>( <10><02>M<EFBFBD> "<22>"r2c<01><00>]tRtRtRtRtR#)r<>i<>zRetry in `_only_one_at_a_time`.r*Nr+r*r2r3r<>r<><00>s<00><00>%r2r<>c
<01>,<00>V^8<>dQhRRRRRRRRRR/#<00> r;<00>bufferr'<00>from_rowrt<00>to_rowr;r@rAr*)rBs"r3rCrC<00>s6<00><00>@<01>@<01>6<EFBFBD>@<01>S<EFBFBD>@<01>#<23>@<01>c<EFBFBD>@<01>$<24>@r2c<05>Za<08>VPPpVPPp\W4pRV,oVP VV3Rl4p\ V\ V4P V^44VnV;PV\S4,, unR#)z+
Indent text of a :class:`.Buffer` object.
<EFBFBD> c<01><<01>SV,#rFr*)r<><00>indent_contents&<26>r3r<><00>indent.<locals>.<lambda><3E>s
<00><><00>N<EFBFBD>Q<EFBFBD><Nr2N<> r<>r\rKr<>r)r<00>translate_row_col_to_indexr_rQ) r<>r<>r<>r;<00> current_row<6F> current_col<6F>
line_rangergrs &&&& @r3<00>indentr
<00>s<><00><><00><19>/<2F>/<2F>5<>5<>K<EFBFBD><18>/<2F>/<2F>5<>5<>K<EFBFBD><16>x<EFBFBD>(<28>J<EFBFBD><1C>e<EFBFBD>^<5E>N<EFBFBD><15>%<25>%<25>j<EFBFBD>2N<32>O<>H<EFBFBD><1E><10>(<28>8<EFBFBD>$<24>?<3F>?<3F> <0B>Q<EFBFBD>O<><06>F<EFBFBD>O<EFBFBD>
 <0B><1A><1A>k<EFBFBD>C<EFBFBD><0E>,?<3F>?<3F>?<3F>r2c
<01>,<00>V^8<>dQhRRRRRRRRRR/#r<>r*)rBs"r3rCrC<00>s6<00><00>@<01>@<01>V<EFBFBD>@<01>s<EFBFBD>@<01>C<EFBFBD>@<01><03>@<01>D<EFBFBD>@r2c<05>ba <09>VPPpVPPp\W4pRV,o RV 3RllpVP Wg4p\ V\ V4P V^44VnV;PV\S 4,
, unR#)z-
Unindent text of a :class:`.Buffer` object.
rc<01> <00>V^8<>dQhRRRR/#)r;r^rLr@r*)rBs"r3rC<00>unindent.<locals>.__annotate__<5F>s<00><00>!<21>!<21><03>!<21><03>!r2c<01>r<<01>SpVPV4'dV\V4R#VP4#rF)r<>rQrx)r^<00>removers& <20>r3<00> transform<72>unindent.<locals>.transform<72>s4<00><><00><1F><06> <0F>?<3F>?<3F>6<EFBFBD> "<22> "<22><17><03>F<EFBFBD> <0B> <0A>&<26> &<26><17>;<3B>;<3B>=<3D> r2Nr)
r<EFBFBD>r<>r<>r;rrr rrgrs
&&&& @r3<00>unindentr<00>s<><00><><00><19>/<2F>/<2F>5<>5<>K<EFBFBD><18>/<2F>/<2F>5<>5<>K<EFBFBD><16>x<EFBFBD>(<28>J<EFBFBD><1B>e<EFBFBD>^<5E>N<EFBFBD>!<21>!<21><16>%<25>%<25>j<EFBFBD><<3C>H<EFBFBD><1E><10>(<28>8<EFBFBD>$<24>?<3F>?<3F> <0B>Q<EFBFBD>O<><06>F<EFBFBD>O<EFBFBD>
 <0B><1A><1A>k<EFBFBD>C<EFBFBD><0E>,?<3F>?<3F>?<3F>r2c<01>(<00>V^8<>dQhRRRRRRRR/#)r;r<>r'r<>rtr<>r@rAr*)rBs"r3rCrC<00>s(<00><00>-
<EFBFBD>-
<EFBFBD><16>-
<EFBFBD>3<EFBFBD>-
<EFBFBD><03>-
<EFBFBD><04>-
r2c <05><><00>VPPR4pVRVpW2^,RpW1V^,pV'Ed<>\P!RV^,4pV'dVP 4M^pV^,RVP RR4p RP V4P4p
VP;'g^P\V 4,
p V .p ^p V
F<>pV 'd^\V4V ,^,V 8<>d&V PR4V PV 4^p MV PR4V ^, p V PV4V \V4, p K<> V R,R8wdV PR4\RP WL,V,4\RP WL,44R7Vn R#R#) zY
Reformat text, taking the width into account.
`to_row` is included.
(Vi 'gq' operator.)
TNz^\s*r$rrvr}r~) r^r<><00>re<72>search<63>end<6E>replacer'r%r<>rQrrr<>)r<>r<>r<>r(<00> lines_before<72> lines_after<65>lines_to_reformat<61>match<63>lengthr
r<><00>width<74> reshaped_text<78> current_widthr<68>s&&& r3<00> reshape_textr"<00>s<><00><00> <13>K<EFBFBD>K<EFBFBD> "<22> "<22>4<EFBFBD> (<28>E<EFBFBD><18><19>(<28>#<23>L<EFBFBD><17><11>
<EFBFBD> <0C>%<25>K<EFBFBD><1D><16>!<21><1A>4<><15><18><18><12> <09> <09>'<27>#4<>Q<EFBFBD>#7<>8<><05> %<25><15><19><19><1B>1<EFBFBD><06>"<22>1<EFBFBD>%<25>g<EFBFBD>v<EFBFBD>.<2E>6<>6<>t<EFBFBD>R<EFBFBD>@<40><06><13><07><07>)<29>*<2A>0<>0<>2<><05><18>"<22>"<22>(<28>(<28>b<EFBFBD>C<EFBFBD><06>K<EFBFBD>7<><05><1F><08> <0A><19> <0A><16>A<EFBFBD><1C><16>q<EFBFBD>6<EFBFBD>M<EFBFBD>)<29>A<EFBFBD>-<2D><05>5<>!<21>(<28>(<28><14>.<2E>!<21>(<28>(<28><16>0<>$%<25>M<EFBFBD>!<21>(<28>(<28><13>-<2D>!<21>Q<EFBFBD>&<26>M<EFBFBD> <19> <20> <20><11> #<23> <19>S<EFBFBD><11>V<EFBFBD> #<23>M<EFBFBD><17> <19><12> <1C><04> $<24> <19> <20> <20><14> &<26>#<23><13><17><17><1C>5<> <0B>C<>D<><1F><02><07><07> <0C>(D<> E<>F<>
<EFBFBD><06><0F>?r2)r&r'r(r
rr"r<>)Ur0<00>
__future__rr<><00>loggingr\rr<>rpr<>r<><00> collectionsr<00>enumr<00> functoolsr<00>typingrrrr r
r <00>application.currentr <00>application.run_in_terminalr r<>rr<00>cacher<00> clipboardrr<>rrrrrr<>r<00> eventloopr<00>filtersrrr<>rrrrrrCrr r!<00>utilsr"r#<00>
validationr$r%<00>__all__<5F> getLoggerr,r<><00> Exceptionr&r5r(<00>compiler<65>rq<00>BufferEventHandlerr<72><00>BufferAcceptHandlerr'r<>r<>r<>r
rr"r*r2r3<00><module>r7s?<00><01><04>
#<23><0E><0E> <09> <09> <0C> <0A><11><0F><1D><15><1B>D<>D<>(<28>8<>1<> <20>$<24><02><02><1F><1F>,<2C>-<2D>0<>?<3F>?<3F> <20>2<> <02><07>
<11> <1A> <1A>8<EFBFBD> $<24><06>5<><19>5<><18>d<EFBFBD><18>?<14>?<14>D<16>:<3A>:<3A>6<>7<><10> ^<02> ^<02> <1E>x<EFBFBD>j<EFBFBD>$<24>.<2E>/<2F><12><1E><08>z<EFBFBD>4<EFBFBD>/<2F>0<><13>K<1D>K<1D>\6 <0A>T<EFBFBD><18>#<23>y<EFBFBD><13>c<EFBFBD>4<EFBFBD><1E>'@<40>"@<40>A<>B<><02>#<23>D&<26>Y<EFBFBD>&<26>@<01>&@<01>6-
r2