Comments (15)
It is because ext.escape treats multi-character pairs as a single character, this issue will be solved in the next release.
Until then, you can disable escape with { "\\(", "\\)", ft = { "tex" } , noescape = true }
from ultimate-autopair.nvim.
Thank you, that works!
However, I have another question. Now, when the pair is in place, and the cursor is at |
, i.e., \(|\)
, pressing \
will bring me out of the pair. I want to disable this behavior, as in latex, it is often the case that I will input a command that starts with \
when I am in that position. How can I do that?
from ultimate-autopair.nvim.
Currently, that is not easily possible.
Will implement it in the next release.
from ultimate-autopair.nvim.
Ok, fixed, and the feature added in v0.6.0 (for more info read the Q&A)
(Note: To update to v0.6.0, remove the plugin totally and reinstall)
from ultimate-autopair.nvim.
The problem with the new version now is that the rule you provided does not even work. In fact, the default quotes map for tex also doesn't work.
from ultimate-autopair.nvim.
Fixed; the problem was that treesitter uses latex and not tex as languagetree:lang().
So replace {ft={'text'}}
with {ft={'text','latex'}}`
from ultimate-autopair.nvim.
I commented out the double quotes rule for tex from internal pairs, and tried to add this rule:
{ "`", "'", fly = true, ft = { "tex", "latex" } }
but this one doesn't work; why?
from ultimate-autopair.nvim.
That's weird, cause it works with the minimal config:
vim.fn.system{'git','clone','--depth=1','https://github.com/altermo/ultimate-autopair.nvim',vim.fn.stdpath('data')..'/ultimate-autopair'}
vim.opt.runtimepath:append(vim.fn.stdpath('data')..'/ultimate-autopair')
require'ultimate-autopair'.setup{{'`',"'",fly=true,ft={'tex','latex'}}}
vim.cmd.setf'tex'
from ultimate-autopair.nvim.
I located the plugin causing the issue. It is actually vimtex. Whenever vimtex is enabled, the ` rule does not work. However, I already disabled the auto-expanding snippets from vimtex that start with `, so I don't know why this is still happening. Working alongside vimtex would be ideal, since virtually everyone writing latex on vim uses it.
Additionally,
{ "`", "`", nft = { "tex", "latex" }, multiline = false }
and
{ "`", "'", fly = true, ft = { "tex", "latex" } }
cannot coexist. The former breaks the backspace behavior of the latter, despite the filetype specifications.
from ultimate-autopair.nvim.
For the vimtex, I need a config to be able to search for what causes what.
And for the backspace, in what way does it break?
from ultimate-autopair.nvim.
For the broken backspace, it deletes two `s at once, without deleting any 's. So
``|'' --backspace--> |''
from ultimate-autopair.nvim.
Fixed; the problem was that only a select cases of backspace(/newline) ran through the filter and the rest ignored it.
from ultimate-autopair.nvim.
Indeed fixed. Thanks!
Something more drastic I noticed with vimtex. It is not that the backtick rule doesn't work; it works, but it interprets the single quotes not on the current line as the ending character. And so, it does not insert the single quote on the same line. Then, when I delete the backtick, a single quote that is very far away from the backtick (on the lines below) gets deleted. I think the multiline behavior is erroneously enabled for this rule when vimtex is enabled.
from ultimate-autopair.nvim.
Ok, setting multiline to false explicitly fixes it. It is still puzzling; what is the default setting for multiline? Why vimtex enabled means multiline on, and vimtex disabled means multiline off, even though I didn't set the multiline option at all in the original rule? Is it perhaps the timing of the filtetype detection that is affected by vimtex, which in turn affects whether the explicit multiline = false
option from the nft = { "tex", "latex" }
backtick rule gets transferred to the ft = { "tex", "latex" }
backtick rule?
from ultimate-autopair.nvim.
The default for multiline is true.
Can you give a minimal config so that I can also research it?
from ultimate-autopair.nvim.
Related Issues (20)
- [Question] How to ignore a specific parser? HOT 1
- Builtin C-style block comment support HOT 2
- [Question] - JSX Support HOT 4
- alpha extension unexpected behavior HOT 2
- Support for lua `[=[...]=]` string? HOT 4
- [Performance] Holding on space in large markdown files freeze the editor HOT 3
- [Bug] Incorrect pair exiting behavior HOT 1
- [BUG] Wrong behavior when deleting asterisk in makdown files HOT 1
- Healthcheck fails saying parser is missing for 'lua' HOT 4
- [Feature Request] Specify pairs by regular expression HOT 2
- Way to prevent autocomplete if Esc is pressed? HOT 16
- Delete comma after pair HOT 6
- Undo mappings in insert mode don't work as expected HOT 3
- [BUG] Installing ultimate-autopair causes luasnip to malfunction HOT 2
- Parenths don't auto close in swift files with swift string interpolation HOT 5
- Feature request: fastwarp for left parenthesis
- Suround vs Surround HOT 2
- Bug: `in_string()` errors in `ftplugin/lua.lua` HOT 4
- [Bug] Pairing in Select mode doesn't work when LSP server loads HOT 3
- [Bug] Enter binding breaks when using `ray-x/lsp_signature.nvim` HOT 2
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 ultimate-autopair.nvim.