-
Notifications
You must be signed in to change notification settings - Fork 22
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
Inconsistent behaviour when cursor is in comment line #247
Comments
Thanks for reporting the bug! I will see this later. |
Interestingly, cc does not work, but cd does. |
I can't replicate the bug. Everything works as expected on my side. |
Maybe you could disable some plugins to see if they interfere with |
This is a different plugin called markview.nvim, it's IMHO even better looking and more plug and play. But you are right, when I get the chance I'll test with a minimal config. Do you already have one ready? |
You can find examples of minimal config at https://github.com/R-nvim/R.nvim/blob/main/README.md and https://github.com/R-nvim/R.nvim/wiki/Configuration |
I replaced By the way, I still can't replicate the bug. |
Noted. I will let you know if the minimal config works later this week. |
I can confirm I have the same issue with the minimal config you provided ( Same problems as above when Example.qmd
|
I can't replicate the bug with the same command, |
Could you delete the Since I can't replicate the bug, we have to wait until someone can fix it and make a pull request. |
I have tried regenerating all parsers but that did not solve the issues (with
starting from the top: Sorry I can be of more help, @PMassicotte seem to have similar issues as me?
|
I will check that on my side when I am back to the office on Monday. |
This works fine on my side. This here my code file ---
format:
html:
useMath: true
standalone: true
embed-resources: true
self-contained: true
self-contained-math: true
# pdf:
# documentclass: article
# toc: false
# number-sections: true
# colorlinks: true
# #cite-method: biblatex
# header-includes:
# - |
# ```{=latex}
# \usepackage{fvextra}
# \DefineVerbatimEnvironment{Highlighting}{Verbatim}{
# breaksymbolleft={},
# showspaces = false,
# showtabs = false,
# breaklines,
# commandchars=\\\{\}
# }
# ```
# gfm:
# output-file: "README"
# output-ext: "md"
# fig-dpi: 300
title: ""
author: "Andrea Finocchio"
#bibliography: cite.bib
citeproc: true
link-citations: true
code-fold: true
fig-dpi: 300
engine: knitr
highlight-style: gruvbox
cache: false
code-overflow: wrap
---
```{r}
#| lst-label: lst-imports-and-functions-r
#| lst-cap: lst-imports-and-functions-r
#| code-summary: "Imports and Functions - R"
#| output: false
#| code-fold: true
library(tidyverse)
library(reticulate)
library(ggthemes)
library(ggpubr)
library(kableExtra)
# library(EnvStats)
With me using send lines: |
I am a bit out of ideas, are there any debug logs I can look at and share? If it helps I am on version |
This is a tree-sitter problem, perhaps a mismatch between the parser you are using and the one we use. I have two Neovim versions in my notebook: 0.9.5 (Debian package) and 0.11.0-dev (compiled from source) and I can't replicate the bug in any of them. |
Is there a way I can check and report back that info? Or try your version? |
You could try the minimal config from the Wiki (https://github.com/R-nvim/R.nvim/wiki/Configuration):. Save it as
|
I have done that already but no luck. |
I'm sorry, I repeated myself. I have no new idea, only what has already been said:
|
@andy941 do you still experience this problem? |
@PMassicotte hi, yes I do. Both Linux and macos, both with my config and the minimal one. Tried deleting and reinstalling all tresitter parsers too. My terminal is kitty. I am just a bit out of ideas about what to try! I am happy to do more debugging. |
@Spacecortez fixed a tree-sitter-related bug by forcing the update of |
Hi @jalvesaq @PMassicotte, I'll try again this weekend and let you know, thank you. |
Update: I tried all the suggestions in the thread linked:
The problem seem to be on comment lines, which break the "detection" of the code block (chunk). |
I am a bit confused. I do not know how to tackle this since I can not replicate the issue. Can you report the results of |
Sure:
|
You pasted the output of |
OOOPS sorry!
|
The only thing differing with me is
Could you try to install ts cli (https://github.com/tree-sitter/tree-sitter/blob/master/cli/README.md). Thereafter check if
|
Did that, checkhealth shows no error anymore, force reinstalling of all parsers. The problem persists unfortunately. |
I am out of ideas, what about you @jalvesaq ? |
Me too. |
Sorry if I can't be of more help guys ... I'll keep on looking. What puzzles me is that it was not working even with the minimal config and reinstalled all treesitter parsers. |
We need to find the cause and the solution of this. Maybe we will have to use the poor man debugging/printing in the code to see what is going on at each step. |
My only idea is to try again:
|
I got a breakthrough although I am puzzled as of why: using ONLY the minimal config's treesitter parsers fixes the issue, regardless of wheter I use the minimal.lua or my own init.lua.
Any ideas? I feel we are getting close. Is there more targeted debugging I can do? Thanks, |
Can you still see the bug? If it disappeared, then it was something outdated in your config. It would be better to know precisely what was outdated, but it would be too complicated to downgrade everything and upgrade everything again one plugin at a time. If the bug is back, then you could try adding your other parsers one at a time until you find which one is interfering with the markdown parser. I don't know how a parser could interfere with how another one works unless one language is injected into the other. The only debugging tool for tree-sitter that I know is the command |
The bug reappears with all parsers installed which is ~300 so that would be impossible. I can try adding the ones that are needed first and see if I get lucky, I will do that when I have some time and report back. Seems like language injection is precisely what should happen with code cells in a quarto/markdown document, maybe it's something like that then. I'll let you know |
Something similar to a binary search would still be slow, but perhaps tolerably slow: add 150 parsers. If the bug is triggered, remove everything and add 75... |
@PMassicotte might have a better idea... |
I will come back with some suggestions soon, I am teaching tomorrow, taking too much of my time :) |
Sometimes, a line isn't sent to R if there is HTML code somewhere above the R code chunk. I added the current language where the cursor is to the message that the cursor isn't in R or Python code: - inform("Not inside R or Python code chunk.")
+ inform("Not inside R or Python code chunk [within " .. lang .. "]") Maybe the two bugs are related, but I couldn't find a simple example to reproduce this new bug. |
Maybe related to #221, i.e. wrong node selected across different versions of nvim. |
It was my fault. I have left some unclosed tags in manually written HTML code. There was an unclosed |
Is it fixed now? |
I could never replicate the bug reported here, but the HTML issue wasn't a bug. It was my mistake and is fixed. |
@PMassicotte sure, do you have a specific tag/version/commit I should try? Sorry I dropped the ball on this, I am very swamped at work. |
@andy941, are you still experiencing the bug? Could you, please, try the branch "strange_fix"? I could never replicate this issue, but, since it's a strange bug, if we are lucky the "strange_fix" will fix it. |
@jalvesaq I won't be able to try anything before the 13th of January but I will do so when I can. Thanks for the help, I'll keep you posted. |
@andy941, could you update
?
|
@jalvesaq thanks! Here's the output:
This is on Nixos 24.11, unstable channel, and nix develop environment (the one I use for data science projects). I'll try on my work Mac tomorrow too and kep you posted. I updated to latest before running checkhealth. |
What's weird is that I can't seem to be able to find |
It is strange that you can't install the |
I got the LaTeX parser problem. The solution was to use
|
When the cursor is in a comment in a code chunk (Quarto) some keybindings do not work:
RSendChunk
fails withNot inside an R code chunk
RPreviousRChunk
does nothing. Weirdly enough, if there are more than one comment line in the chunk it does nothing if I am on the first comment line, if I am in any other comment line it will bring me to the first one.Both commands work perfectly well in the non-comment lines in the chunk for both Python and R chunks.
One other thing to note is that instead
RNextRChunk
works in comment lines too which makes it all even more confusing.TO be clear this affects all the times when the cursor is in any comment line not only
|#
.Could it be a bug?
The text was updated successfully, but these errors were encountered: