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

Ctrl+] fails to jump to function definition after using Ctrl-T in .c file #600

Closed
YSW0630 opened this issue Dec 5, 2024 · 1 comment
Closed

Comments

@YSW0630
Copy link

YSW0630 commented Dec 5, 2024

Description:
When I use Ctrl+] in a *.c file to jump to a function's definition, it works correctly the first time. However, if I use Ctrl-T, :bdelete to jump back to the original *.c file and then use Ctrl+] again on the same function call, it reports "Couldn't get the TranslationUnit". However, there's no such problem in a C++ file

Steps to Reproduce:

  1. Open a *.c file.
  2. Place the cursor on a function call.
  3. Press Ctrl+]. (This should successfully jump to the function definition.)
  4. Press Ctrl-T to return to the original *.c file.
  5. Press Ctrl+] again on the same function call. (This should fail with the error message.)

Expected Behavior:
Ctrl+] should consistently jump to the function definition, regardless of whether Ctrl-T was used in between.

@YSW0630 YSW0630 changed the title Title: Ctrl+] fails to jump to function definition after using Ctrl-T Ctrl+] fails to jump to function definition after using Ctrl-T in .c file Dec 5, 2024
@YSW0630
Copy link
Author

YSW0630 commented Dec 9, 2024

I Just figured that remove the

autocmd filetype c let g:clang_user_options='-std=c11'
autocmd filetype cpp let g:clang_user_options='-std=c++20'

can fix the issue.

@YSW0630 YSW0630 closed this as completed Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant