@limwz01 Thanks for the patches.
If I'm not mistaken, you are making this change only for the select line case, am I right? I think for line selection, updating "last X" makes sense; however, I think it shouldn't be done universally in the `sci_` wrappers. They are accessible to plugins and plugins can use them for various purposes, possibly combining several `sci_` functions, and we cannot be sure if they really want to update "last X".
So I'd suggest moving the "last X" update to the actual line selection implementation, i.e. `editor_select_lines()`.
Regarding `SCI_SWAPMAINANCHORCARET`, I'm not sure - other editors may do it this way, on the other hand it has been like this in Geany since the beginning and I can imagine some people got used to this behavior so maybe better not to break it for them.