|
|
|
|
@ -1328,7 +1328,7 @@ void Source::View::setup_format_style(bool is_generic_view) {
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if(language_id == "latex") { |
|
|
|
|
else if(is_latex) { |
|
|
|
|
static auto yapf = filesystem::find_executable("latexindent"); |
|
|
|
|
if(!yapf.empty()) { |
|
|
|
|
format_style = [this](bool continue_without_style_file, bool ignore_selection) { |
|
|
|
|
@ -1678,6 +1678,7 @@ void Source::View::extend_selection() {
|
|
|
|
|
int angle_count = 0; |
|
|
|
|
int curly_count = 0; |
|
|
|
|
auto start_comma_iter = get_buffer()->end(); |
|
|
|
|
auto start_dollar_iter = get_buffer()->end(); |
|
|
|
|
auto start_angle_iter = get_buffer()->end(); |
|
|
|
|
auto start_angle_reversed_iter = get_buffer()->end(); |
|
|
|
|
while(start.backward_char()) { |
|
|
|
|
@ -1722,6 +1723,10 @@ void Source::View::extend_selection() {
|
|
|
|
|
para_count == 0 && square_count == 0 && curly_count == 0 && |
|
|
|
|
*start == ',' && is_code_iter(start)) |
|
|
|
|
start_comma_iter = start; |
|
|
|
|
else if(!start_dollar_iter && |
|
|
|
|
para_count == 0 && square_count == 0 && curly_count == 0 && |
|
|
|
|
*start == '$' && is_code_iter(start)) |
|
|
|
|
start_dollar_iter = start; |
|
|
|
|
else if(!start_sentence_iter && |
|
|
|
|
para_count == 0 && square_count == 0 && curly_count == 0 && |
|
|
|
|
*start == ';' && is_code_iter(start)) |
|
|
|
|
@ -1739,6 +1744,7 @@ void Source::View::extend_selection() {
|
|
|
|
|
angle_count = 0; |
|
|
|
|
curly_count = 0; |
|
|
|
|
auto end_comma_iter = get_buffer()->end(); |
|
|
|
|
auto end_dollar_iter = get_buffer()->end(); |
|
|
|
|
auto end_angle_iter = get_buffer()->end(); |
|
|
|
|
auto end_angle_reversed_iter = get_buffer()->end(); |
|
|
|
|
do { |
|
|
|
|
@ -1780,6 +1786,10 @@ void Source::View::extend_selection() {
|
|
|
|
|
para_count == 0 && square_count == 0 && curly_count == 0 && |
|
|
|
|
*end == ',' && is_code_iter(end)) |
|
|
|
|
end_comma_iter = end; |
|
|
|
|
else if(!end_dollar_iter && |
|
|
|
|
para_count == 0 && square_count == 0 && curly_count == 0 && |
|
|
|
|
*end == '$' && is_code_iter(end)) |
|
|
|
|
end_dollar_iter = end; |
|
|
|
|
else if(!end_sentence_iter && |
|
|
|
|
para_count == 0 && square_count == 0 && curly_count == 0 && |
|
|
|
|
*end == ';' && is_code_iter(end)) |
|
|
|
|
@ -1951,6 +1961,11 @@ void Source::View::extend_selection() {
|
|
|
|
|
} |
|
|
|
|
select_matching_brackets = true; |
|
|
|
|
} |
|
|
|
|
else if(is_latex && start_dollar_iter && start < start_dollar_iter && end_dollar_iter && end > end_dollar_iter) { |
|
|
|
|
start = start_dollar_iter; |
|
|
|
|
end = end_dollar_iter; |
|
|
|
|
select_matching_brackets = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Attempt to select a sentence, for instance: int a = 2;
|
|
|
|
|
if(!is_bracket_language) { // If for instance cmake, meson or python
|
|
|
|
|
@ -3727,7 +3742,7 @@ bool Source::View::on_key_press_event_smart_inserts(GdkEventKey *event) {
|
|
|
|
|
right = "*/"; |
|
|
|
|
} |
|
|
|
|
// Insert $$ around selection
|
|
|
|
|
else if(event->keyval == GDK_KEY_dollar && language_id == "latex") { |
|
|
|
|
else if(is_latex && event->keyval == GDK_KEY_dollar) { |
|
|
|
|
left = '$'; |
|
|
|
|
right = '$'; |
|
|
|
|
} |
|
|
|
|
|