New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange behavior for backspace with lines ending with more than 4 spaces in notebook #1464
Comments
The exception being if the line is only whitespace (i.e. indentation with no code typed yet) - then we only want to take off 4 spaces at a time. |
good point, so the logic should go with (1) take off 4 spaces (or move to the right indent location) for empty line and (2) remove all tailing space for non-empty line. If people think this is fine, I can submit a patch. |
The current algorithm only looks at the 4 preceding the cursor and if they are all spaces, then 4 spaces are deleted. This logic is applied regardless of where the cursor is located. I am not convinced we want to change this as it would make the logic run on every backspace more complex. But if you want to try to implement it and see if that logic can be made very clean, it might be worth it. |
I'm afraid that absent a reviewed PR, this isn't realistic to have a 0.13 target, being we're days away from releasing. @cschin, please feel free to submit a PR with the fix you like best and we'll be happy to review/merge it! |
sorry, too busy on my daytime job. I will file a PR post 0.13 |
Update code mirror 2.22 to 2.32 Update codemirror to the latest stable. And upadte our code here and there to smooth the changes. Just the fact that there is a new tab system that was inserting tabs instead of 4 space, we just have to pass a new line when creating e new CM instance. Should also fix ipython#1464. See Readme-IPython to see what patch to apply when updating next.
In a line with more than 4 spaces at the end, the backspace deletes 4 characters before the current cursor position regardless whether the cursor is at the end or not. Is this the intended behavior? The fix seems quite simple. In the meantime, should we simply delete all white space at the end of line if backspace is hit at the end of the line?
The text was updated successfully, but these errors were encountered: