Git Product home page Git Product logo

Comments (11)

sbdchd avatar sbdchd commented on September 2, 2024

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.

alok avatar alok commented on September 2, 2024

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.

adamyonk avatar adamyonk commented on September 2, 2024

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.

sbdchd avatar sbdchd commented on September 2, 2024

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.

adamyonk avatar adamyonk commented on September 2, 2024

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.

sbdchd avatar sbdchd commented on September 2, 2024

Interesting. Can you provide an example file?

from neoformat.

adamyonk avatar adamyonk commented on September 2, 2024

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.

sbdchd avatar sbdchd commented on September 2, 2024

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.

adamyonk avatar adamyonk commented on September 2, 2024

Here's a gif of what I'm seeing:
feb-17-2017 10-49-59

from neoformat.

sbdchd avatar sbdchd commented on September 2, 2024

Okay, I can reproduce this bug now.

Would you mind creating a fresh issue for this?

from neoformat.

adamyonk avatar adamyonk commented on September 2, 2024

#55

from neoformat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.