Merge pull request #379 from jonyrock/auto_brace_complete_open_bug_fix
call during autocompletion
This commit is contained in:
commit
2495df4ffc
@ -750,7 +750,6 @@ void TextEdit::_consume_pair_symbol(CharType ch) {
|
|||||||
CharType ch_single_pair[2] = {_get_right_pair_symbol(ch), 0};
|
CharType ch_single_pair[2] = {_get_right_pair_symbol(ch), 0};
|
||||||
CharType ch_pair[3] = {ch, _get_right_pair_symbol(ch), 0};
|
CharType ch_pair[3] = {ch, _get_right_pair_symbol(ch), 0};
|
||||||
|
|
||||||
printf("Selectin if active, %d\n", is_selection_active());
|
|
||||||
if(is_selection_active()) {
|
if(is_selection_active()) {
|
||||||
|
|
||||||
int new_column,new_line;
|
int new_column,new_line;
|
||||||
@ -1132,11 +1131,17 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
|
|||||||
if (cursor.column<text[cursor.line].length() && text[cursor.line][cursor.column]==k.unicode) {
|
if (cursor.column<text[cursor.line].length() && text[cursor.line][cursor.column]==k.unicode) {
|
||||||
//same char, move ahead
|
//same char, move ahead
|
||||||
cursor_set_column(cursor.column+1);
|
cursor_set_column(cursor.column+1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//different char, go back
|
//different char, go back
|
||||||
const CharType chr[2] = {k.unicode, 0};
|
const CharType chr[2] = {k.unicode, 0};
|
||||||
_insert_text_at_cursor(chr);
|
if(auto_brace_completion_enabled && _is_pair_symbol(chr[0])) {
|
||||||
|
_consume_pair_symbol(chr[0]);
|
||||||
|
} else {
|
||||||
|
_insert_text_at_cursor(chr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_update_completion_candidates();
|
_update_completion_candidates();
|
||||||
accept_event();
|
accept_event();
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ bool FindReplaceDialog::_search() {
|
|||||||
|
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
print_line("found");
|
// print_line("found");
|
||||||
text_edit->cursor_set_line(line);
|
text_edit->cursor_set_line(line);
|
||||||
text_edit->cursor_set_column(col+text.length());
|
text_edit->cursor_set_column(col+text.length());
|
||||||
text_edit->select(line,col,line,col+text.length());
|
text_edit->select(line,col,line,col+text.length());
|
||||||
@ -492,7 +492,7 @@ void CodeTextEditor::_complete_request(const String& p_request, int p_line) {
|
|||||||
|
|
||||||
List<String> entries;
|
List<String> entries;
|
||||||
_code_complete_script(text_editor->get_text(),p_request,p_line,&entries);
|
_code_complete_script(text_editor->get_text(),p_request,p_line,&entries);
|
||||||
print_line("COMPLETE: "+p_request);
|
// print_line("COMPLETE: "+p_request);
|
||||||
Vector<String> strs;
|
Vector<String> strs;
|
||||||
strs.resize(entries.size());
|
strs.resize(entries.size());
|
||||||
int i=0;
|
int i=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user