Skip to content
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

indentation formatting error after several comment lines #1062

Closed
mesqueeb opened this issue Feb 12, 2018 · 2 comments

Comments

@mesqueeb
Copy link

commented Feb 12, 2018

I have a formatting problem where the there are countless of indentation mistakes after a few lines of comments.

I have deleted many lines for the sake of focussing on just the wrong formatting.

before:

duplicate ({state, getters, commit, dispatch},
	{id = state.selection.selectedId} = {id:state.selection.selectedId})
{
	return new Promise((resolve, reject) => {
		function doRecursively(item, newParentId) {
			// Set up a dupe of the main item & add a node without inserting into the DOM yet.
			let dupeItem = JSON.parse(JSON.stringify(item));
			return dupeItem.id
		}

		dispatch('addItem', {item: mainDupeItem, index, addNextItemAs: 'stop'})
		.then(_ => {
			// One after each other:
				// causes bugs with syncing children_order of mainDupeItem afterwards. I DONT KNOW WHY
			// dispatch('postNewItem', {items: [mainDupeItem]})
			// .then(_ => dispatch('postNewItem', {items: dupeChildren}))
			// In one go:
			dispatch('postNewItem', {items: mainAndAllChildren})
			.then(_ => {
				console.log('finished Duplication of :', id);
				resolve('finished Duplicate', _)
			})
			.catch(error => reject(error));
		});
	});
},

after:

  duplicate ({state, getters, commit, dispatch},
  {id = state.selection.selectedId} = {id: state.selection.selectedId}) {
    return new Promise((resolve, reject) => {
      function doRecursively (item, newParentId) {
      // Set up a dupe of the main item & add a node without inserting into the DOM yet.
        let dupeItem = JSON.parse(JSON.stringify(item))
        return dupeItem.id
      }

      dispatch('addItem', {item: mainDupeItem, index, addNextItemAs: 'stop'})
    .then(_ => {
      // One after each other:
        // causes bugs with syncing children_order of mainDupeItem afterwards. I DONT KNOW WHY
      // dispatch('postNewItem', {items: [mainDupeItem]})
      // .then(_ => dispatch('postNewItem', {items: dupeChildren}))
      // In one go:
  dispatch('postNewItem', {items: mainAndAllChildren})
      .then(_ => {
  console.log('finished Duplication of :', id)
  resolve('finished Duplicate', _)
})
      .catch(error => reject(error))
})
    })
  },

Please see this final part where all indentation gets really messy.

@stale

This comment has been minimized.

Copy link

commented May 13, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 13, 2018

@feross feross added the question label May 15, 2018

@feross

This comment has been minimized.

Copy link
Member

commented May 15, 2018

There were significant improvements to indentation in standard v11 and this issue was likely already fixed.

@feross feross closed this May 15, 2018

@stale stale bot removed the stale label May 15, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.