Open GenesisFR opened 3 years ago
Ok so I modified the code like this and it does fix the problem, however it creates a similar problem when pressing Delete at the beginning of the line:
if(sc.2167(Start)=sc.2008&&Start>0&&sc.2008=sc.2009){
return sc.2645((SPos:=sc.2136(Start-1)),sc.2128(Start)-SPos)
}
Alright, this should fix both problems:
if(sc.2167(Start)=sc.2008&&Start>0&&sc.2008=sc.2009&&sub!=0){
return sc.2645((SPos:=sc.2136(Start-1)),sc.2128(Start)-SPos)
}
I suppose I could make an option for it, but you can also press Shift+{Backspace} which bypasses the normal Backspace routine.
I'll look at what you coded to see if it still keeps the functionality of removing all of the spaces before the beginning of the line.
It does keep that functionality as long as the caret is at the beginning of the line, before any space/tab.
Now that I'm reading it again, did you mean it should also remove all spaces/tabs at the end of the previous line once the current line is merged with it? Because it doesn't in both of our versions.
I never intended it to do that. I do not leave any whitespace at the end of my lines so it never really occurred to me.
Ok, I'll update my pull request tonight to also fix that.
Unfortunately, I haven't found anything that could help detecting whitespace at the end of a line in the Scintilla documentation. I don't leave whitespace at the end of lines so that's not a problem for me either.
Maybe if there's a way of reversing the order of all the characters of the previous line, removing the indentation at the beginning of the reversed line (if there's any), then reversing the line again? Just throwing an idea out there.
@maestrith I don't know what you did in your commits for 1.005.37 (all commits between 1.005.00 and 1.005.37 are gone?) but #235 wasn't merged. The code is slightly different than what it was before though.
I updated AHK Studio to confirm and the issue still persists.
I understand it is a QOL, however if you have tabbed lines like in this example:
Pressing Backspace while the caret is at the beginning of the second line will result in
While pressing Backspace while the caret is before KeyWait will result in
I do this all the time and it's really annoying. I had to locally revert the changes from 8a7d1ae at line 421. I think the problem comes from sc.2128(Start) which isn't the beginning of the line but the end of the indentation at the beginning of the line. It should be replaced by something like GETLINEBEGINPOSITION (which I can't seem find or create).
The expected behavior should be the reverse, it should only remove tabs when you're at the beginning of the line (like stated in the commit description).