summaryrefslogtreecommitdiff
path: root/scene/gui/line_edit.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-10 15:38:53 +0200
committerGitHub <noreply@github.com>2020-05-10 15:38:53 +0200
commit6ab92464bc6356f3342c3efd1fc1bb1a5e4467d5 (patch)
tree405a85e89e036e2240c74ee850121d912e21704b /scene/gui/line_edit.cpp
parent54b20a25b90c8c8d8dfd7f68d66d0ec57c71435f (diff)
parent69de7ce38c40c57a1fabe12c9e5a3eab903a4035 (diff)
Merge pull request #38621 from akien-mga/stylé-comme-jamais
Style: clang-format: Disable if statements and case labels on single line
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r--scene/gui/line_edit.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index b9b7560f2e..8574b05016 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -463,14 +463,16 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
case KEY_UP: {
shift_selection_check_pre(k->get_shift());
- if (get_cursor_position() == 0) handled = false;
+ if (get_cursor_position() == 0)
+ handled = false;
set_cursor_position(0);
shift_selection_check_post(k->get_shift());
} break;
case KEY_DOWN: {
shift_selection_check_pre(k->get_shift());
- if (get_cursor_position() == text.length()) handled = false;
+ if (get_cursor_position() == text.length())
+ handled = false;
set_cursor_position(text.length());
shift_selection_check_post(k->get_shift());
} break;
@@ -988,7 +990,8 @@ void LineEdit::paste_text() {
if (paste_buffer != "") {
int prev_len = text.length();
- if (selection.enabled) selection_delete();
+ if (selection.enabled)
+ selection_delete();
append_at_cursor(paste_buffer);
if (!text_changed_dirty) {
@@ -1204,7 +1207,8 @@ void LineEdit::_toggle_draw_caret() {
void LineEdit::delete_char() {
- if ((text.length() <= 0) || (cursor_pos == 0)) return;
+ if ((text.length() <= 0) || (cursor_pos == 0))
+ return;
Ref<Font> font = get_theme_font("font");
if (font != nullptr) {
@@ -1379,7 +1383,8 @@ int LineEdit::get_cursor_position() const {
void LineEdit::set_window_pos(int p_pos) {
window_pos = p_pos;
- if (window_pos < 0) window_pos = 0;
+ if (window_pos < 0)
+ window_pos = 0;
}
void LineEdit::append_at_cursor(String p_text) {