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

Multiline #159

Merged
merged 7 commits into from
Sep 4, 2015
Merged

Multiline #159

merged 7 commits into from
Sep 4, 2015

Conversation

danielshahaf
Copy link
Member

The 'main' highlighter does not highlight certain multiline constructs
correctly. By code inspection, it disregards $PREBUFFER entirely, so any
multiline construct where the start of a line is not a new command would be
misparsed and mishighlighted. This patch series fixes a few such cases.
Regression tests are included.

The new function will be used in the next commit.
Given the following input:
    PREBUFFER=$'echo "foo\n'
    BUFFER='bar"'
This patch causes the '"foo' part to be highlighted as a string.  There
is no test because the tests only check highlighting of BUFFER, and 'bar"'
is already highlighted correctly.
@danielshahaf
Copy link
Member Author

I've pushed another commit to the branch that handles the before-the-newline part of multiline strings. (I accidentally left that part out during a rebase.)

@danielshahaf
Copy link
Member Author

The fourth patch 384be15 does not fix the case of a literal newline immediately followed by a space. It does fix the case of a literal newline immediately followed by non-whitespace. I presume the whitespace-skipping logic of $start_pos is the issue.

@danielshahaf
Copy link
Member Author

The fourth patch 384be15 does not fix the case of a literal newline immediately followed by a space.

Fixed by the just-pushed commit c2b9327.

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

Successfully merging this pull request may close these issues.

1 participant