Comments (11)
Hmm, I am trying to test out your wrap function on some files, but I am not having any luck seeing the difference between it and plain Neoformat
. Can you provide some example to demonstrate the before and after behavior? Thanks!
from neoformat.
It turns out neoformat does do that. I used that function for markdown files, when it turns out that they were using the wrong mapping because of my shada/viminfo file remembers too much, including old mappings.
doh!
from neoformat.
I'm seeing Neoformat move my cursor to the top of the window on every :w
with the prettier
formatter. Is there a setting I need to change or something?
from neoformat.
Neoformat should be able to save the cursor position to the extent that is possible with vim.
winsave()
is used which saves cursor position along with some other things: https://github.com/sbdchd/neoformat/blob/master/autoload/neoformat.vim#L1-L11
Does the issue occur when using js-beautify
as a formatter or is it only with prettier
?
from neoformat.
Yeah, if I setup:
let g:neoformat_jsx_jsbeautify = {
\ 'exe': 'js-beautify',
\ }
then
:Neoformat jsbeautify
it returns
Neoformat: no change necessary with js-beautify
and puts the cursor at the top.
from neoformat.
Interesting. Can you provide an example file?
from neoformat.
Sure! The file I'm editing:
import styled from "styled-components";
const Heading = styled.h1`
color: #0f80aa;
font-family: sans-serif;
font-size: 50px;
`;
export default Heading;
My Neoformat settings:
let g:neoformat_enabled_javascript = ['prettier']
let g:neoformat_enabled_jsx = ['prettier']
autocmd! BufWritePre *.js Neoformat
from neoformat.
I have tested that file with the following setup:
prettier --version: 0.18.0
Neoformat b479ba0
And I am :Neoformat prettier
is saying that there is no change necessary.
from neoformat.
Here's a gif of what I'm seeing:
from neoformat.
Okay, I can reproduce this bug now.
Would you mind creating a fresh issue for this?
from neoformat.
from neoformat.
Related Issues (20)
- clang-format used when formatter fails in some filetypes
- [Solved] fprettify makes nvim buffer empty HOT 1
- C# clang-format with Microsoft style broken HOT 1
- truncating files HOT 1
- Pyi files
- Clang-format doesn't use the style config file closest to the file's location
- Formatting F# buffer replaces it with error message
- g:neoformat_only_msg_on_error not working correctly
- Topiary support HOT 1
- Monorepo project root determination
- Adding `eslint_d` as valid formatter for another filetype, like "Vue" HOT 3
- .clang-format file is ignored when style is specified to file
- Configuration on neovim use lua HOT 1
- Add dprint as a formatter HOT 2
- Add ruff formatter for Python HOT 3
- Format only changed lines
- clang-format not work
- Please start tagging releases or remove the old tags
- formatters prettierd, eslint_d failed
- Neoformat Laravel pint keeps removing new line
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 neoformat.