core: properly display newlines in input when multiline is enabled in buffer (issue #984, issue #1063)

This commit is contained in:
Sébastien Helleu 2020-05-09 18:23:33 +02:00
parent 63714855d3
commit f987e445ec

View File

@ -963,6 +963,21 @@ gui_bar_item_input_text_cb (const void *pointer, void *data,
}
}
/*
* if multiline is enabled in buffer, transform '\n' to '\r' to the
* newlines are displayed as real new lines instead of spaces
*/
if (buffer->input_multiline)
{
ptr_input2 = ptr_input;
while (ptr_input2 && ptr_input2[0])
{
if (ptr_input2[0] == '\n')
ptr_input2[0] = '\r';
ptr_input2 = (char *)utf8_next_char (ptr_input2);
}
}
return ptr_input;
}