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

Multi line indenting (Windows) #67

Open
jodastephen opened this issue Jul 11, 2019 · 3 comments
Open

Multi line indenting (Windows) #67

jodastephen opened this issue Jul 11, 2019 · 3 comments

Comments

@jodastephen
Copy link

Thanks for the plugin. I'm using v1.4.2 on Windows with an indent of 2. I see the following problem:

  • Using some yaml like this on Windows with Windows line endings:
  init_maven:
    description: "Initializing Maven"
    steps:
      - run:
          name: Initializing Maven
          command: |
            mkdir -p ./.mvn
  maven_install:
    description: "Maven install"
  • Select multiple lines by placing the cursor at the very start of a line and holding Shift down as you press the down arrow. (eg select the 5 lines from "steps" to the very start of the "maven_install" line).
  • Press Shift-Tab (to move the section one tab space to the left)
  • The last character of the shifted section disappears from view, but it is still in the actual document - if you close the document and reopen it, the character is shown again
  • The line ending of all the selected lines will be changed from Windows-style to Unix-style
  • The same happens when pressing Tab instead of Shift-Tab

I imagine that the Windows/Unix line endings issue is related to the visual disappearance of the last character, given how the original 2 character line endings change to 1 character ones.

This get even messier is you use Ctrl-Z after Shift-Tab. What you get then is an extra blank line in the view after the section that was indented. This extra blank line doesn't exist in the underlying document, so as you scroll up and down, each line is redrawn and jumps up. Again, I think solving the line ending issue would probably solve this too.

@de-jcup
Copy link
Owner

de-jcup commented Nov 13, 2019

Could you please link or upload an example file here (with your endings) ?

@jodastephen
Copy link
Author

An example file is as above - just use Windows line endings \r\n on a machine running Windows. (ie. any example yaml file has the issue)

@elonderin
Copy link

i can confirm this issue, but only after i switched to \r\n line endings in the file menu (my default is to use just \n even on windows)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants