Comments (16)
I updated the branch fix_get_lang
...
from r.nvim.
Seems to be any time I'm on the last line of the chunk
from r.nvim.
Probably something off by 1 somewhere.
from r.nvim.
I confirm the bug. It works in Quarto, but not in RMarkdown.
from r.nvim.
Trying to debug this issue, I changed lualine_x
in my lualine
config to show the output of get_lang()
.
sections = {
lualine_a = { "mode" },
lualine_b = { {'branch', icon = ''}, "diagnostics" },
lualine_c = { "filename", "searchcount", },
-- lualine_x = { selectionCount },
lualine_x = { require("r.utils").get_lang },
lualine_y = { {rstatus, color = rsttcolor }},
lualine_z = { "progress", "location" },
},
After that, the bug disappeared, even if I removed get_lang
from my lualine
config. However, based on the error message that I got in my first attempt to display the output of get_lang
in the Neovim status line, I created the branch https://github.com/R-nvim/R.nvim/tree/fix_get_lang
Could you try it and see if it makes any difference (since I could no longer replicate the bug even before the changes)?
from r.nvim.
On the fix_get_lang
branch but still face both issues. Alt-- results in <M-->
instead of the usual <-
. Get notified that I'm not in inside a R or Python code chunk. This even happens when I'm not on the last line in a chunk.
from r.nvim.
It works on my side. So, we might have different tree-sitter parsers. You can try:
- The command
:TSUpdate
- Add "yaml" to the list of parsers to be installed.
- Delete the
nvim-treesitter
directory to force the installation of new parsers.
from r.nvim.
On the main branch, if I have a chunk of R code in an Rmd
file with just two lines, x
and y
, and press <M-->
three times after x
and after y
I get:
x <- <- <-
y <- <M--><M-->
On the fix_get_lang
branch, I get:
x <- <- <-
y <- <- <-
So, I believe that now I know how to replicate the bug reliably and that it is fixed on the fix_get_lang
branch.
from r.nvim.
I followed the instructions regarding tree-sitter and am on the latest update on the fix_get_lang
branch. With my test file. I still face the issue of R.nvim saying Not inside R or Python code chunk
. I'm not sure if this is the same issue as what has been discussed and resolved here though. Should this conversation continue here or should I open a new issue?
from r.nvim.
It's the same issue. It's fixed here, but not there. I tried nvim 0.9-5 (from the Debian package) and nvim 0.11.0-dev (installed from source some days ago). Because I can't replicate the issue, the only thing that I can do is merge the branch anyway since it at least fixes the bug on my side.
from r.nvim.
Is there any recommendation you have for troubleshooting this? Sorry for the trouble 🙈
EDIT: Facing this issue in Quarto.
EDIT: I can get it to reliably work as long as my cursor is on the firstl line of the code block. Anything else and it won't work.
from r.nvim.
Okay, I'm facing this issue with everything other than RSendParagraph
and RDSendParagraph
. These 2 work and the rest don't.
from r.nvim.
Next attempt:
Create the simplest Quarto document that replicates the bug and run this command:
:InspectTree
Post here the quarto document and the contents of the left window (the tree of nodes of treesitter).
It will also help if you enable treesitter highlighting instead of Vim's syntax highlight because you will see if treesitter is recognizing the code as R.
from r.nvim.
I do have tree-sitter syntax highlighting enabled. Everything else works fine in the code block (LSP diagnostics, auto-complete, etc). I'm even able to send lines to R, but only if I'm using RSendParagraph
or RDSendParagraph
. The line and selection based ones are the ones that throw the Not inside R or Python code chunk
.
However, the line based ones do work after I've run :InspectTree
. They continue to work even after I've closed the InspectTree window. What might be up here?
Trying to debug this issue, I changed
lualine_x
in my lualine config to show the output ofget_lang()
.
It sounds kinda similar to this situation, doesn't it?
from r.nvim.
With exactly the same 7 lines in a .Rmd
I get exactly the same output.
However, the line based ones do work after I've run :InspectTree. They continue to work even after I've closed the InspectTree window. What might be up here?
Perhaps lazy=false
in nvim-treesitter
could make a difference...
from r.nvim.
It didn't :(
Really appreciate y'all being so patient with me. I'll just continue trying to figure this one out and share any updates.
from r.nvim.
Related Issues (20)
- Breaking changes introduced by the latest version of treesitter? HOT 29
- Issue from LSP? HOT 3
- Upcoming R version might break nvimcom HOT 7
- nvimcom fails to compile since 4f28bfd HOT 3
- Has function of `<Leader>l` and `<Leader>d` been changed? HOT 10
- In tmux RDSendLine does not work when opening a second buffer HOT 3
- Running R in a ToggleTerm HOT 4
- .Rnw does not highlight latex syntax until I do :e HOT 3
- renv is ignored when using external_term HOT 10
- Rpipe sends keymap string instead of pipe operator `|>` HOT 9
- Syntax highlighting is not enabled in the help window HOT 4
- Better capture nodes for printing the object under the cursor HOT 6
- omnifunc not set HOT 3
- What is the proper place to custom map/keybindings? HOT 3
- nvimcom:::source.and.clean inconsistently needs plot() HOT 7
- Commands in R markdown (.rmd) documents not sent when nested in HTML tags HOT 9
- Segmentation Fault in nvimcom When Opening and Closing R Files Without Starting R HOT 8
- Add pyodide and webr extensions to qmd HOT 4
- Server crashes when trying to use `spData` package HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r.nvim.