Comments (13)
#41 should fix the issue.
Edit: it's merged. Can you check if it's good on your side?
from nvim-treesitter-context.
Dupicate of #16
from nvim-treesitter-context.
It is currently not reproducible on my setup. What version of things are you using? All up to date?
from nvim-treesitter-context.
Yes
Latest nvim nightly release as of now.
NVIM v0.5.0-dev+1194-gc20ae3aad
Build type: RelWithDebInfo
Every plugin and treesitter parser is up to date
from nvim-treesitter-context.
Can you apply this patch, and report what you see in :message
after trying to insert a few chars?
diff --git a/lua/treesitter-context.lua b/lua/treesitter-context.lua
index 0f5f35a..c8c3d27 100644
--- a/lua/treesitter-context.lua
+++ b/lua/treesitter-context.lua
@@ -186,6 +186,7 @@ do
local line
cursor_moved_vertical = function()
local newline = vim.api.nvim_win_get_cursor(0)[1]
+ log_message({newline, line})
if newline ~= line then
line = newline
return true
The gutter width shouldn't update when the cursor hasn't moved vertically.
from nvim-treesitter-context.
I'm not getting any messages in :message
after applying the patch
from nvim-treesitter-context.
Oh right forgot to remove the silents:
diff --git a/lua/treesitter-context.lua b/lua/treesitter-context.lua
index 0f5f35a..62b03c5 100644
--- a/lua/treesitter-context.lua
+++ b/lua/treesitter-context.lua
@@ -186,6 +186,7 @@ do
local line
cursor_moved_vertical = function()
local newline = vim.api.nvim_win_get_cursor(0)[1]
+ log_message({newline, line})
if newline ~= line then
line = newline
return true
@@ -489,15 +490,15 @@ end
function M.enable()
nvim_augroup('treesitter_context', {
- {'WinScrolled', '*', 'silent lua require("treesitter-context").update_context()'},
- {'User', 'CursorMovedVertical', 'silent lua require("treesitter-context").update_context()'},
- {'CursorMoved', '*', 'silent lua require("treesitter-context").do_au_cursor_moved_vertical()'},
- {'BufEnter', '*', 'silent lua require("treesitter-context").update_context()'},
- {'WinEnter', '*', 'silent lua require("treesitter-context").update_context()'},
- {'WinLeave', '*', 'silent lua require("treesitter-context").close()'},
- {'VimResized', '*', 'silent lua require("treesitter-context").open()'},
- {'User', 'SessionSavePre', 'silent lua require("treesitter-context").close()'},
- {'User', 'SessionSavePost', 'silent lua require("treesitter-context").open()'},
+ {'WinScrolled', '*', 'lua require("treesitter-context").update_context()'},
+ {'User', 'CursorMovedVertical', 'lua require("treesitter-context").update_context()'},
+ {'CursorMoved', '*', 'lua require("treesitter-context").do_au_cursor_moved_vertical()'},
+ {'BufEnter', '*', 'lua require("treesitter-context").update_context()'},
+ {'WinEnter', '*', 'lua require("treesitter-context").update_context()'},
+ {'WinLeave', '*', 'lua require("treesitter-context").close()'},
+ {'VimResized', '*', 'lua require("treesitter-context").open()'},
+ {'User', 'SessionSavePre', 'lua require("treesitter-context").close()'},
+ {'User', 'SessionSavePost', 'lua require("treesitter-context").open()'},
})
M.throttled_update_context()
from nvim-treesitter-context.
ok now i'm getting messages
[1475]
[1476, 1475]
[1477, 1476]
[1478, 1477]
[1478, 1478]
[1477, 1478]
[1478, 1477]
[1477, 1478]
[1476, 1477]
[1475, 1476]
[1474, 1475]
[1473, 1474]
[1475, 1473]
[1475, 1475]
[1475, 1475]
[1475, 1475]
[1475, 1475]
[1475, 1475]
[1475, 1475]
[1475, 1475]
[1475, 1475]
[1475, 1475]
[1475, 1475]
[1475, 1475]
from nvim-treesitter-context.
And that is without moving the cursor vertically? Does the change below logs "cursor_moved_vertical" when you type text?
diff --git a/lua/treesitter-context.lua b/lua/treesitter-context.lua
index 0f5f35a..cb2bce8 100644
--- a/lua/treesitter-context.lua
+++ b/lua/treesitter-context.lua
@@ -224,6 +224,7 @@ local M = {}
function M.do_au_cursor_moved_vertical()
if cursor_moved_vertical() then
+ log_message({'cursor_moved_vertical'})
vim.cmd [[doautocmd User CursorMovedVertical]]
end
end
from nvim-treesitter-context.
One more thing, are you able to reproduce the issue with a minimal vimrc like this? I still can't reproduce (latest everything), I wonder if it's an interaction with something else.
let $PLUGIN_DIRECTORY = '~/.config/nvim/bundle'
set runtimepath^=$PLUGIN_DIRECTORY/nvim-treesitter
set runtimepath^=$PLUGIN_DIRECTORY/nvim-treesitter-context
from nvim-treesitter-context.
Yes. The bug is still present, running with this config:
nvim -u minimal_config.vim
let $PLUGIN_DIRECTORY = '~/.local/share/nvim/plugged'
set runtimepath^=$PLUGIN_DIRECTORY/nvim-treesitter
set runtimepath^=$PLUGIN_DIRECTORY/nvim-treesitter-context
Not only that, the plugin is even more bugged out when running this config. Take a look at how it behaves
2021-04-08_01-29-13.mp4
from nvim-treesitter-context.
And that is without moving the cursor vertically? Does the change below logs "cursor_moved_vertical" when you type text?
No. After adding some text typing Ahello<esc>
, it just outputs [1500,1500]
from nvim-treesitter-context.
Looks like it's fixed. Great ๐ Thank you
from nvim-treesitter-context.
Related Issues (20)
- Markdown headers Context only shows one parent header with no highlight and other nested children... HOT 1
- not working for R code HOT 1
- Add `'TreesitterContextBottomLineNr'` highlight group HOT 2
- Context not working for python HOT 2
- Context has no highlighting when first opening Neovim HOT 4
- Add `trim_scope = "center"` HOT 1
- The `stl` setting from `'fillchars'` is being displayed in ts-context when using `'statuscolumn'` HOT 3
- context.lua:17: attempt to index local 'tree' (a nil value) HOT 3
- Context header disappears with markdown_inline parser installed HOT 1
- Disbled languages config option HOT 1
- feat: Lua API to get the status of treesitter context
- Very poor performance after โdo not use vim.treesitter.highlighterโ HOT 2
- Use one floating window instead of two. HOT 10
- Multi-line function definition is not handled HOT 1
- Feature Request: Formalise require('treesitter-context.context').get() API HOT 2
- Feat: tag the ts-context windows so they can be identified programmatically HOT 2
- Can this plugin be configured such that scrolloff is respected between the context and the cursor? HOT 2
- Show ruby blocks in context HOT 3
- Julia context queries not updated HOT 10
- height key must be positive integer error while scrolling down in markdown file when the first line is empty HOT 6
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 nvim-treesitter-context.