Skip to content
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

The C command does not respect tabs correctly #307

Open
pjungkamp opened this issue Jul 26, 2023 · 1 comment
Open

The C command does not respect tabs correctly #307

pjungkamp opened this issue Jul 26, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@pjungkamp
Copy link

pjungkamp commented Jul 26, 2023

Summary

  • j/J/k/K handle vertical navigation in files with tabs correctly.
  • C does not take the width of a tab character into account when navigating vertically.

Example

int main(int argc, char const *argv[]) {
    printf("Hello World");
    return 0;
}

Assume this snippet to be indented with a tabwidth of 4.

  1. Copy this example to a new VSCode editor.
  2. Run Change Tab Display Size and set width to 4.
  3. Run Convert Indentation to Tabs.
  4. Type %smain<ret> in normal mode to select the main functions name.
  5. Type C.

Expected Behaviour

main on line 1 and prin on line 2 are selected.

Observed Behaviour

main on line 1 and ntf( on line 2 are selected.

@71 71 added the bug Something isn't working label Jul 26, 2023
@71
Copy link
Owner

71 commented Sep 27, 2023

Thanks for the report! Indeed that's not great. I'm not sure I have time to work on it right now, but here are some pointers:

I suspect fixing C is mostly a matter of using Lines.column() rather than pure VS Code APIs at the right places in tryCopySelection() (and adding a test to avoid future regressions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants