Skip to content

Use PositionMessage for the line context information for ConciseView - #11398

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:conciseview-tabs
Dec 19, 2019
Merged

Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:conciseview-tabs

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Dec 18, 2019 •

Copy link
Copy Markdown
Member

PR Summary

If a script uses tabs instead of spaces, the calculation for the caret for error position is wrong. This is because the InvocationInfo member treats tabs as a single character. However, the pre-rendered PositionMessage member already takes care of the tabs and the correct index so the change is to rely on parsing that to get the information rather than the existing members.

Before and after shot:
img

PR Context

Fix #11394
Fix #10760

PR Checklist

@kborowinski

Copy link
Copy Markdown
Contributor

Steve Lee (@SteveL-MSFT) : Sorry for off-topic but, oh man, you are fast!

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Dec 18, 2019
@ghost

Copy link
Copy Markdown

🎉v7.0.0-rc.2 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConciseView formatting is broken when script body is indented with tabs Long error message in ConciseView

5 participants