From 12db9a2c150edd41bafaf58b119ee88fe75b8814 Mon Sep 17 00:00:00 2001 From: Peti Gomori Date: Wed, 13 Jun 2012 15:53:23 +0200 Subject: Fix Table Viewer crash after a 'Found' -> 'Not found' search sequence Start position was lost after a 'Found' -> 'Not found' search sequence leading an undefined position in the next search --- lib/observer/src/observer_tv_table.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/observer/src/observer_tv_table.erl') diff --git a/lib/observer/src/observer_tv_table.erl b/lib/observer/src/observer_tv_table.erl index 3930f9ee26..d339a853cb 100644 --- a/lib/observer/src/observer_tv_table.erl +++ b/lib/observer/src/observer_tv_table.erl @@ -321,7 +321,7 @@ handle_event(#wx{id=?SEARCH_ENTRY, event=#wxCommand{type=command_text_enter,cmdS wxStatusBar:setStatusText(SB, "Not found"), Pid ! {mark_search_hit, Find#find.start}, wxListCtrl:refreshItem(Grid, Find#find.start), - {noreply, State#state{search=Search#search{find=#find{found=false}}}}; + {noreply, State#state{search=Search#search{find=Find#find{found=false}}}}; Row -> wxListCtrl:ensureVisible(Grid, Row), wxListCtrl:refreshItem(Grid, Row), -- cgit v1.2.3 From f530bdb22a3a59ef97b35d7be11f9c06b0c34356 Mon Sep 17 00:00:00 2001 From: Peti Gomori Date: Wed, 13 Jun 2012 18:35:02 +0200 Subject: Escape control characters in Table Viewer Similar behaviour to old tv. Objects in tables supposed to be printed in a single line and it looks ugly when a [...,10,...] integer list creates a new-line. --- lib/observer/src/observer_tv_table.erl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'lib/observer/src/observer_tv_table.erl') diff --git a/lib/observer/src/observer_tv_table.erl b/lib/observer/src/observer_tv_table.erl index d339a853cb..97d18ec03c 100644 --- a/lib/observer/src/observer_tv_table.erl +++ b/lib/observer/src/observer_tv_table.erl @@ -762,7 +762,7 @@ format_tuple(_Tuple, 1, 0) -> format_list([]) -> "[]"; format_list(List) -> case printable_list(List) of - true -> io_lib:format("\"~ts\"", [List]); + true -> io_lib:format("\"~ts\"", [map_printable_list(List)]); false -> [$[ | make_list(List)] end. @@ -771,6 +771,24 @@ make_list([Last]) -> make_list([Head|Tail]) -> [format(Head), $,|make_list(Tail)]. +map_printable_list([$\n|Cs]) -> + [$\\, $n|map_printable_list(Cs)]; +map_printable_list([$\r|Cs]) -> + [$\\, $r|map_printable_list(Cs)]; +map_printable_list([$\t|Cs]) -> + [$\\, $t|map_printable_list(Cs)]; +map_printable_list([$\v|Cs]) -> + [$\\, $v|map_printable_list(Cs)]; +map_printable_list([$\b|Cs]) -> + [$\\, $b|map_printable_list(Cs)]; +map_printable_list([$\f|Cs]) -> + [$\\, $f|map_printable_list(Cs)]; +map_printable_list([$\e|Cs]) -> + [$\\, $e|map_printable_list(Cs)]; +map_printable_list([]) -> []; +map_printable_list([C|Cs]) -> + [C|map_printable_list(Cs)]. + %% printable_list([Char]) -> bool() %% Return true if CharList is a list of printable characters, else %% false. -- cgit v1.2.3 From 5d299de9e24c79c3029e7d0d0d75bf6ebb774665 Mon Sep 17 00:00:00 2001 From: Peti Gomori Date: Thu, 14 Jun 2012 16:47:03 +0200 Subject: Fix Table Viewer search crash on new|changed|deleted rows --- lib/observer/src/observer_tv_table.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/observer/src/observer_tv_table.erl') diff --git a/lib/observer/src/observer_tv_table.erl b/lib/observer/src/observer_tv_table.erl index 97d18ec03c..786d1a5576 100644 --- a/lib/observer/src/observer_tv_table.erl +++ b/lib/observer/src/observer_tv_table.erl @@ -613,7 +613,7 @@ search([Str, Row, Dir0, CaseSens], search(Row, Dir, Re, Table) -> Res = try lists:nth(Row+1, Table) of - Term -> + [Term|_] -> Str = format(Term), re:run(Str, Re) catch _:_ -> no_more -- cgit v1.2.3