lukasmonk / lucaschessR2

Lucas Chess R Version 2
GNU General Public License v3.0
268 stars 40 forks source link

Opening variations get added in lines before or after the current position making it difficult to have a main line. #82

Open chemtov opened 1 year ago

chemtov commented 1 year ago

Hi,

not a bug, but rather an annoyance.

When I create a new line in the opening it gets inserted sometime before, sometime after. This is annoying (to me) as I usually start with my main line and add up variations, but here the lines get all mixed up.

Then when I practice the first line won't be my main line, but some variation and my main line will be "somewhere".

I didn't find a way to change the order of the line.

Here's is a example. I started with my main line (exd5 for white) and then created a variation (Nxd5) which got inserted before as line number 1.

Screenshot from 2023-03-19 12-18-37

Then, (after closing and re-opening the opening study) I added another variation, and it got inserted after this time:

Screenshot from 2023-03-19 12-30-45

Again, only annoying, but it would nice if variation would get added always after and/or if we could move the line "up and down" in order to re-order them.

Regards,

lukasmonk commented 1 year ago

All lines internally are encoded in an abbreviated mode, forming a string of characters. Internally they are sorted alphabetically, so when adding a variant, the resulting string can be above or below the current one. The advantage is that it is very easy to program. The alternative would be to assign a weight to each movement, which would allow the order to be defined manually, or for new variants to always appear below. The problem is that it is not easy to implement, the idea is simple but the foreseeable side effects are many. I will think about it.