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
next() and next_up() do not jump to the next tag in the vue file #183
Comments
That certainly sounds like a bug. Could you provide a minimal sample file that exhibits this problem? Also, I assume that you're using vuels as your language server? |
@stevearc Configuration file as above, I bind the key is vim.keymap.set("n", "<C-m>", "<cmd>AerialToggle!<CR>", { buffer = bufnr })
vim.keymap.set("n", "<C-k>", "<cmd>lua require('aerial').prev()<CR>", { buffer = bufnr })
vim.keymap.set("n", "<C-j>", "<cmd>lua require('aerial').next()<CR>", { buffer = bufnr }) As you can see, when I press Ctrl+k, everything works fine, but when I press Ctrl+j, it doesn't seem to work. |
I meant can you provide a minimal |
@stevearc This is a demo vue file <template>
<h1>Hello {{ world }}</h1>
</template>
<script>
export default {
name: 'Demo',
data() {
return {
world: 'vue'
}
}
}
</script> |
@stevearc Here's another one <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
<script src="https://unpkg.com/vue@3.2.31/dist/vue.global.js"></script> <!-- 引入Vue3 -->
</head>
<body>
<div id="app">
<h1>Hello {{ lanuage }}</h1>
</div>
</body>
<script>
const app = Vue.createApp({
data() {
return {
lanuage: "Vue"
}
}
})
const vm = app.mount("#app")
</script>
</html> |
Ugh, as expected this is because volar is giving...if not incorrect symbol ranges, then at least surprising ones. The starting column of the symbols is off the end of the line, which means that it's impossible for us to ever be exactly on that symbol and that generally creates issues (navigation being the most obvious). I've added a hack that should work around this, but the real solution is for the language server to produce correct symbol positions. I've reported this upstream vuejs/language-tools#2118 |
@stevearc Thank you, it's working fine now, hopefully upstream can fix it too |
Describe the bug
I'm not sure if it's a bug, but it's really weird
next() and next_up() do not jump to the next tag in the vue file, prev() and prev_up() are fine,
System information
To Reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: