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

Editor freezes when moving the cursor to specific position in .md file #8709

Closed
nicolasspaniol opened this issue Nov 3, 2023 · 3 comments
Closed
Labels
C-bug Category: This is a bug

Comments

@nicolasspaniol
Copy link

Summary

While editing Markdown files with Lua code blocks, the editor freezes if I place the cursor over some characters; usually around strings, but I also had it happen after an "end" keyword. No error is printed and I'm forced to close the terminal. Removing some of the previous lines, like the backticks and other strings, seems to fix the issue.

I managed to reproduce the issue on a fresh EndeavourOS VM with the stripped down file below, so I guess it is not related to my terminal emulator, language server or clipboard provider.

Reproduction Steps

  1. Create a test.md file with the following content:
```
    " "
  a

(" ")
  1. Open the file in helix: hx test.md
  2. Move the cursor down to the opening parenthesis.
  3. Helix freezes just before the cursor reaches the fifth line.

Helix log

~/.cache/helix/helix.log
2023-11-03T11:34:31.624 helix_view::clipboard [DEBUG] Using xclip to interact with the system and selection (primary) clipboard
2023-11-03T11:34:31.642 helix_vcs [INFO] Error {
    context: "failed to open git repo",
    source: Discover(
        NoGitRepository {
            path: "/home/nmspaniol/Downloads",
        },
    ),
}
2023-11-03T11:34:31.642 helix_vcs [INFO] failed to open diff base for /home/nmspaniol/Downloads/test.md
2023-11-03T11:34:31.642 helix_vcs [INFO] Error {
    context: "failed to open git repo",
    source: Discover(
        NoGitRepository {
            path: "/home/nmspaniol/Downloads",
        },
    ),
}
2023-11-03T11:34:31.642 helix_vcs [INFO] failed to obtain current head name for /home/nmspaniol/Downloads/test.md
2023-11-03T11:34:31.642 helix_view::editor [DEBUG] editor status: Loaded 1 file.
2023-11-03T11:34:31.642 helix_lsp::transport [INFO] marksman -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-8","utf-32","utf-16"]},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dataSupport":true,"disabledSupport":true,"isPreferredSupport":true,"resolveSupport":{"properties":["edit","command"]}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"versionSupport":true},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":true},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":false},"executeCommand":{"dynamicRegistration":false},"inlayHint":{"refreshSupport":false},"symbol":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true,"failureHandling":"abort","normalizesLineEndings":false,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"23.10"},"processId":7253,"rootPath":"/home/nmspaniol","rootUri":null,"workspaceFolders":[]},"id":0}
2023-11-03T11:34:31.643 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 200.259µs)
2023-11-03T11:34:31.643 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-03T11:34:31.876 helix_term::application [DEBUG] received editor event: IdleTimer
2023-11-03T11:34:31.904 helix_lsp::transport [ERROR] marksman err <- "[11:34:31 INF] <LSP Entry> Starting Marksman LSP server: {}\n"
2023-11-03T11:34:32.272 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-03T11:34:32.442 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-03T11:34:32.560 helix_lsp::transport [INFO] marksman <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":1},"hoverProvider":true,"completionProvider":{"triggerCharacters":["[","#","("]},"definitionProvider":true,"referencesProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":{"resolveProvider":false},"renameProvider":{"prepareProvider":true},"semanticTokensProvider":{"legend":{"tokenTypes":["class","class","enumMember"],"tokenModifiers":[]},"range":true,"full":{"delta":false}},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true},"fileOperations":{"didCreate":{"filters":[{"pattern":{"glob":"**/*.{}","matches":"file","options":{"ignoreCase":true}}}]},"didDelete":{"filters":[{"pattern":{"glob":"**/*.{}","matches":"file","options":{"ignoreCase":true}}}]}}}}}}
2023-11-03T11:34:32.560 helix_lsp::transport [INFO] marksman <- {"capabilities":{"codeActionProvider":{"resolveProvider":false},"completionProvider":{"triggerCharacters":["[","#","("]},"definitionProvider":true,"documentSymbolProvider":true,"hoverProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"semanticTokensProvider":{"full":{"delta":false},"legend":{"tokenModifiers":[],"tokenTypes":["class","class","enumMember"]},"range":true},"textDocumentSync":{"change":1,"openClose":true},"workspace":{"fileOperations":{"didCreate":{"filters":[{"pattern":{"glob":"**/*.{}","matches":"file","options":{"ignoreCase":true}}}]},"didDelete":{"filters":[{"pattern":{"glob":"**/*.{}","matches":"file","options":{"ignoreCase":true}}}]}},"workspaceFolders":{"changeNotifications":true,"supported":true}},"workspaceSymbolProvider":true}}
2023-11-03T11:34:32.560 helix_lsp::transport [INFO] marksman -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2023-11-03T11:34:32.560 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: None, method: "initialized", params: None })))
2023-11-03T11:34:32.560 helix_lsp::transport [INFO] marksman -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"markdown","text":"```\n    \" \"\n  a\n\n(\" \"\n","uri":"file:///home/nmspaniol/Downloads/test.md","version":0}}}
2023-11-03T11:34:32.595 helix_term::application [DEBUG] received editor event: Redraw
2023-11-03T11:34:32.595 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-11-03T11:34:32.600 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0

Platform

EndeavourOS Linux x86_64

Terminal Emulator

contour 0.3.12.262-1

Helix Version

helix 23.10-1

@nicolasspaniol nicolasspaniol added the C-bug Category: This is a bug label Nov 3, 2023
@the-mikedavis
Copy link
Member

Did you build from source or use a pre-built package based on the 23.10 tag? This might be #7689 - it's a problem that's fixed in the tree-sitter dependency on master but hasn't been released (in tree-sitter) yet. We reverted to the latest tag release of tree-sitter in #8396 just before releasing 23.10 and switched back to master afterwards, so this should not be reproducible on the latest Helix master if you build from source.

@nicolasspaniol
Copy link
Author

Indeed, I was using the pre-built package from pacman in both cases and building from source fixes the problem. Somehow I missed that issue! Thanks for the help.

@sweetbbak
Copy link

helix.mp4

Ive had the same issue except its when the cursor moves laterally over a character that is adjacent to any "=" signs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants