You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Merge pull request #6775 from RandomShaper/one-based-col-numbers
Make text column numbers one-based
This commit is contained in:
@@ -943,7 +943,7 @@ void GDTokenizerText::set_code(const String& p_code) {
|
|||||||
}
|
}
|
||||||
code_pos=0;
|
code_pos=0;
|
||||||
line=1; //it is stand-ar-ized that lines begin in 1 in code..
|
line=1; //it is stand-ar-ized that lines begin in 1 in code..
|
||||||
column=0;
|
column=1; //the same holds for columns
|
||||||
tk_rb_pos=0;
|
tk_rb_pos=0;
|
||||||
error_flag=false;
|
error_flag=false;
|
||||||
last_error="";
|
last_error="";
|
||||||
|
|||||||
@@ -1051,7 +1051,7 @@ void CodeTextEditor::_reset_zoom() {
|
|||||||
void CodeTextEditor::_line_col_changed() {
|
void CodeTextEditor::_line_col_changed() {
|
||||||
|
|
||||||
line_nb->set_text(itos(text_editor->cursor_get_line() + 1));
|
line_nb->set_text(itos(text_editor->cursor_get_line() + 1));
|
||||||
col_nb->set_text(itos(text_editor->cursor_get_column()));
|
col_nb->set_text(itos(text_editor->cursor_get_column() + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeTextEditor::_text_changed() {
|
void CodeTextEditor::_text_changed() {
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ void ShaderTextEditor::_validate_script() {
|
|||||||
Error err = ShaderLanguage::compile(code,type,NULL,NULL,&errortxt,&line,&col);
|
Error err = ShaderLanguage::compile(code,type,NULL,NULL,&errortxt,&line,&col);
|
||||||
|
|
||||||
if (err!=OK) {
|
if (err!=OK) {
|
||||||
String error_text="error("+itos(line+1)+","+itos(col)+"): "+errortxt;
|
String error_text="error("+itos(line+1)+","+itos(col+1)+"): "+errortxt;
|
||||||
set_error(error_text);
|
set_error(error_text);
|
||||||
get_text_edit()->set_line_as_marked(line,true);
|
get_text_edit()->set_line_as_marked(line,true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user