Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libdiodon/file-clipboard-item.vala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ namespace Diodon
_label += p.replace(home, "~");

if (_label.char_count() > 50) {
_label = _label.substring(0, 50) + "...";
long index_char = _label.index_of_nth_char(50);
_label = _label.substring(0, index_char) + "...";
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion libdiodon/text-clipboard-item.vala
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ namespace Diodon
// label should not be longer than 50 letters
_label = _text;
if (_label.char_count() > 50) {
_label = _label.substring(0, 50) + "...";
long index_char = _label.index_of_nth_char(50);
_label = _label.substring(0, index_char) + "...";
}
_label = _label.replace("\n", " ");
}
Expand Down