Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
2623-tty-Remove-duplicate-line-clear.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2623-tty-Remove-duplicate-line-clear.patch of Package erlang
From 1c9b24edf3d510900a6188dc087fa47c03598d99 Mon Sep 17 00:00:00 2001 From: Lukas Larsson <lukas@erlang.org> Date: Tue, 19 Dec 2023 21:53:16 +0100 Subject: [PATCH 03/11] tty: Remove duplicate line clear Since delete_line uses clear after cursor, it will implicitly also clear the the expand buffer, so we place it before expand buffer handling so that we don't issue commands to clear the expand buffer twice. --- lib/kernel/src/prim_tty.erl | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/kernel/src/prim_tty.erl b/lib/kernel/src/prim_tty.erl index 480b399d4b..755673a8cd 100644 --- a/lib/kernel/src/prim_tty.erl +++ b/lib/kernel/src/prim_tty.erl @@ -693,6 +693,14 @@ handle_request(State = #state{ buffer_expand = Expand, buffer_expand_row = ERow, true -> 1 %% No need to page expand rows end, handle_request(State#state{buffer_expand_row = ERow1}, redraw_prompt); +handle_request(State = #state{unicode = U, cols = W, buffer_before = Bef, + lines_before = LinesBefore}, delete_line) -> + MoveToBeg = move_cursor(State, cols_multiline(Bef, LinesBefore, W, U), 0), + {[MoveToBeg, State#state.delete_after_cursor], + State#state{buffer_before = [], + buffer_after = [], + lines_before = [], + lines_after = []}}; %% Clear the expand buffer after the cursor when we handle any request. handle_request(State = #state{ buffer_expand = Expand, unicode = U}, Request) when Expand =/= undefined -> @@ -727,17 +735,6 @@ handle_request(State = #state{}, delete_after_cursor) -> {[State#state.delete_after_cursor], State#state{buffer_after = [], lines_after = []}}; -handle_request(State = #state{buffer_before = [], buffer_after = [], - lines_before = [], lines_after = []}, delete_line) -> - {[],State}; -handle_request(State = #state{unicode = U, cols = W, buffer_before = Bef, - lines_before = LinesBefore}, delete_line) -> - MoveToBeg = move_cursor(State, cols_multiline(Bef, LinesBefore, W, U), 0), - {[MoveToBeg, State#state.delete_after_cursor], - State#state{buffer_before = [], - buffer_after = [], - lines_before = [], - lines_after = []}}; handle_request(State = #state{ unicode = U, cols = W }, {delete, N}) when N > 0 -> {_DelNum, DelCols, _, NewBA} = split(N, State#state.buffer_after, U), BBCols = cols(State#state.buffer_before, U), -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor