1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Editor: fixed port ordering in tools menu

This commit is contained in:
Cristian Maglie 2018-11-12 13:40:43 +01:00 committed by Cristian Maglie
parent d5e0e59fcf
commit 2647ce36ea

View File

@ -1060,7 +1060,8 @@ public class Editor extends JFrame implements RunnerListener {
Collections.sort(ports, new Comparator<BoardPort>() {
@Override
public int compare(BoardPort o1, BoardPort o2) {
return BOARD_PROTOCOLS_ORDER.indexOf(o1.getProtocol()) - BOARD_PROTOCOLS_ORDER.indexOf(o2.getProtocol());
return (BOARD_PROTOCOLS_ORDER.indexOf(o1.getProtocol()) - BOARD_PROTOCOLS_ORDER.indexOf(o2.getProtocol())) * 10 +
o1.getAddress().compareTo(o2.getAddress());
}
});