Merge pull request #28481 from iwek7/issue28446/highlighingOfWhitespaces
Disable higlighting all occurences of selection in editor if it contains only whitespaces
This commit is contained in:
commit
5f3dd5fdc7
1 changed files with 4 additions and 1 deletions
|
@ -825,6 +825,9 @@ void TextEdit::_notification(int p_what) {
|
||||||
// get the highlighted words
|
// get the highlighted words
|
||||||
String highlighted_text = get_selection_text();
|
String highlighted_text = get_selection_text();
|
||||||
|
|
||||||
|
// check if highlighted words contains only whitespaces (tabs or spaces)
|
||||||
|
bool only_whitespaces_highlighted = highlighted_text.strip_edges() == String();
|
||||||
|
|
||||||
String line_num_padding = line_numbers_zero_padded ? "0" : " ";
|
String line_num_padding = line_numbers_zero_padded ? "0" : " ";
|
||||||
|
|
||||||
int cursor_wrap_index = get_cursor_wrap_index();
|
int cursor_wrap_index = get_cursor_wrap_index();
|
||||||
|
@ -1123,7 +1126,7 @@ void TextEdit::_notification(int p_what) {
|
||||||
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + char_w + ofs_x - 1, ofs_y), Size2i(1, get_row_height())), border_color);
|
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + char_w + ofs_x - 1, ofs_y), Size2i(1, get_row_height())), border_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highlight_all_occurrences) {
|
if (highlight_all_occurrences && !only_whitespaces_highlighted) {
|
||||||
if (highlighted_text_col != -1) {
|
if (highlighted_text_col != -1) {
|
||||||
|
|
||||||
// if we are at the end check for new word on same line
|
// if we are at the end check for new word on same line
|
||||||
|
|
Loading…
Reference in a new issue