mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:12:43 +00:00 
			
		
		
		
	TextEditor: Implement replacement functionality
This patch adds a new replace widget that cooperates with the find widget, the replace widget takes the input in the find textbox, searches for occurences of that input, and replaces them with the input provied in the replace textbox.
This commit is contained in:
		
							parent
							
								
									2b20e8e187
								
							
						
					
					
						commit
						ecf58ddd4f
					
				
					 3 changed files with 131 additions and 13 deletions
				
			
		|  | @ -64,8 +64,9 @@ public: | |||
|     // FIXME: This should take glyph spacing into account, no?
 | ||||
|     int glyph_width() const { return font().glyph_width('x'); } | ||||
| 
 | ||||
|     bool write_to_file(const StringView& path); | ||||
| 
 | ||||
|     void insert_at_cursor_or_replace_selection(const StringView&); | ||||
|     bool write_to_file(const StringView& path); | ||||
|     bool has_selection() const { return m_selection.is_valid(); } | ||||
|     String selected_text() const; | ||||
|     void set_selection(const GTextRange&); | ||||
|  | @ -156,7 +157,6 @@ private: | |||
|     int ruler_width() const; | ||||
|     Rect ruler_content_rect(size_t line) const; | ||||
|     void toggle_selection_if_needed_for_event(const GKeyEvent&); | ||||
|     void insert_at_cursor_or_replace_selection(const StringView&); | ||||
|     void delete_selection(); | ||||
|     void did_update_selection(); | ||||
|     int content_x_for_position(const GTextPosition&) const; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 0xtechnobabble
						0xtechnobabble