summaryrefslogtreecommitdiffstats
path: root/editor/find_in_files.h
diff options
context:
space:
mode:
authorMarc Gilleron <marc.gilleron@gmail.com>2018-08-19 00:36:44 +0100
committerMarc Gilleron <marc.gilleron@gmail.com>2018-08-19 19:24:39 +0100
commit09c55f43cffa57da44cd07569bd406bc916ba8fc (patch)
treea55c59d27351ab5bb49fb4d6f0e4951a37577492 /editor/find_in_files.h
parentff8e6f920cd99954c3394412713950c1195199f2 (diff)
downloadredot-engine-09c55f43cffa57da44cd07569bd406bc916ba8fc.tar.gz
Find in Files improvements
- Search results are now grouped by file using a Tree control - You can opt out occurences when using replace mode - Double-check search results in case files have been tampered with, so occurrences don't get badly replaced - Fixed replace bug when an occurrence is found twice in one line
Diffstat (limited to 'editor/find_in_files.h')
-rw-r--r--editor/find_in_files.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/editor/find_in_files.h b/editor/find_in_files.h
index d57184960b..75ea1c3161 100644
--- a/editor/find_in_files.h
+++ b/editor/find_in_files.h
@@ -131,7 +131,8 @@ private:
};
class Button;
-class ItemList;
+class Tree;
+class TreeItem;
class ProgressBar;
// Display search results
@@ -159,22 +160,37 @@ private:
void _on_result_found(String fpath, int line_number, int begin, int end, String text);
void _on_finished();
void _on_cancel_button_clicked();
- void _on_result_selected(int i);
+ void _on_result_selected();
+ void _on_item_edited();
void _on_replace_text_changed(String text);
void _on_replace_all_clicked();
- void apply_replaces_in_file(String fpath, PoolIntArray locations, String text);
+ struct Result {
+ int line_number;
+ int begin;
+ int end;
+ float draw_begin;
+ float draw_width;
+ };
+ void apply_replaces_in_file(String fpath, const Vector<Result> &locations, String new_text);
void update_replace_buttons();
String get_replace_text();
+
+ void draw_result_text(Object *item_obj, Rect2 rect);
+
void set_progress_visible(bool visible);
+ void clear();
FindInFiles *_finder;
Label *_search_text_label;
- ItemList *_results_display;
+ Tree *_results_display;
Label *_status_label;
Button *_cancel_button;
ProgressBar *_progress_bar;
+ Map<String, TreeItem *> _file_items;
+ Map<TreeItem *, Result> _result_items;
+ bool _with_replace;
HBoxContainer *_replace_container;
LineEdit *_replace_line_edit;