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

In some cases AceJump last non-whitespace character marker will overlap stuff. #222

Closed
saroff opened this issue Mar 13, 2018 · 3 comments
Closed
Labels

Comments

@saroff
Copy link

saroff commented Mar 13, 2018

Test file:

export class SomeService {

    getSomething(): any {
        let some = [];
        some.push(
            {
                title: 'sometitle',
                onClick: () => {this.}
            }
        )
    }

    doSomething() {
        console.log('YEAH!');
    }
}

When i press ctrl+; -> right arrow staying before last curly brace in line onClick.... next to last curly brace in file is overlapped by tag:

image

But if i add empty line after it, it works as expected:

image

@breandan breandan added the bug label Mar 24, 2018
@breandan
Copy link
Collaborator

This is probably caused by a tag alignment issue. Thanks for reporting.

@breandan breandan closed this as completed Apr 4, 2021
@breandan breandan reopened this Apr 4, 2021
@breandan
Copy link
Collaborator

breandan commented Apr 4, 2021

I have confirmed the above issue is still present in 3.7. In case anyone is interested in contributing a fix, this method is the most likely culprit:

private fun alignTag(editor: Editor, cache: EditorOffsetCache, font: TagFont, occupied: List<Rectangle>): Rectangle? {
val boundaries = VISIBLE_ON_SCREEN
if (hasSpaceRight || offsetL == 0 || editor.immutableText[offsetL - 1].let { it == '\n' || it == '\r' }) {
val rectR = createRightAlignedTagRect(editor, cache, font)
return rectR.takeIf { boundaries.isOffsetInside(editor, offsetR, cache) && occupied.none(rectR::intersects) }
}
val rectL = createLeftAlignedTagRect(editor, cache, font)
if (occupied.none(rectL::intersects))
return rectL.takeIf { boundaries.isOffsetInside(editor, offsetL, cache) }
val rectR = createRightAlignedTagRect(editor, cache, font)
if (occupied.none(rectR::intersects))
return rectR.takeIf { boundaries.isOffsetInside(editor, offsetR, cache) }
return null
}

@breandan
Copy link
Collaborator

Merging with #323.

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

No branches or pull requests

2 participants