Skip to content

Commit

Permalink
Merge pull request geany#3640 from eht16/issue3624_do_not_none_charset
Browse files Browse the repository at this point in the history
Do not show charset "None" in the list of encodings
  • Loading branch information
b4n committed Dec 9, 2023
2 parents ffaa383 + 17523e5 commit 512e88d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/encodings.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@ gchar *encodings_to_string(const GeanyEncoding* enc)
g_return_val_if_fail(enc->name != NULL, NULL);
g_return_val_if_fail(enc->charset != NULL, NULL);

return g_strdup_printf("%s (%s)", enc->name, enc->charset);
if (enc->idx == GEANY_ENCODING_NONE)
return g_strdup(enc->name); // enc->charset is "None" and would be useless to display
else
return g_strdup_printf("%s (%s)", enc->name, enc->charset);
}


Expand Down

0 comments on commit 512e88d

Please sign in to comment.