Open asottile opened 2 years ago
I would like to take this issue, but I'm not totally sure if I get it right. May you please explain it a bit more?
^-right from beginning of the line goes to the wrong place when the line is indented with a tab -- it should go to the same position as if the line were indented with spaces
I couldn't reproduce this, it seems just the same for me. I tested it on the given example above and one on a random example
do you have an actual tab character?
Yes, I do. Probably I'm doing something wrong!
try these two (press ^Right after opening either of them)
babi +2 - <<< $'\n\thello world\n\n hello world\n'
babi +4 - <<< $'\n\thello world\n\n hello world\n'
First:
Second:
yeah see how they are not the same?
Oh, I get it now. That was so hard to notice for me!
I tried to run Pytest before changing anything just to ensure that everything is working fine before I start but I get the following for some reason:
E FileNotFoundError: [Errno 2] No such file or directory: 'tmux'
Also, I should not trust test_ctrl_right_jump_by_word
after changing right?
going to assume you're new to software development -- usually the response to "No such file or directory: X" should be to figure out why you don't have X
the existing tests should all pass after your change
Clearly, the issue is from line 378 or it's because of the wrong value of comparison between tp and the current x. I tried to remove that and it was working fine for me, though I cannot ensure that will be right for all cases since I'm still not able to run the tests because of a problem with Hecate. https://github.com/asottile/babi/blob/c51484c0fceca8e79ace00f9b20243d756afc604/babi/file.py#L376-L381
As Murtada-Altarouti stop working on this issue. I want to ask what is expected behaviour on this? Couse now tab works the same as single space. And the code works becouse we normally use 4 spaces. What should happen when we have \t\t in our code editor?
compare the following press ^+right when cursor is at left edge depending on whether it's a tab or a space