fix(ui): Harden extmark decorations and detect unknown config keys#38
Merged
Merged
Conversation
Origin highlight, diagnostic underline, and viewport truncation markers now wrap nvim_buf_set_extmark in pcall and clamp the origin row to the buffer line count, so a stale row or an end_col past a truncated line drops only that decoration instead of raising and breaking the popup.
The render and keymap modules carried slightly diverged copies of the header-cursor guard. Move a single implementation to stack_view.state and call it from render, keymaps, and init, keeping the header-only no-op behaviour and the nil-safe header_lines handling.
setup() now compares the merged config against the default schema and reports keys it does not recognise (e.g. ui.popups instead of ui.popup) via vim.notify, while skipping user-keyed subtrees such as the icon map and node_types so custom providers and filetypes are not flagged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pcalland clamp the origin row so a stale row or an out-of-rangeend_coldrops only that decoration instead of breaking the popup.ensure_non_header_cursorimplementations into a singlestack_view.statehelper.vim.notify) on unknown or mistypedsetup()config keys while still degrading gracefully.Changes
pcallthe extmark so a buffer that shrank after the popup opened no longer raises.end_col.feedback_specand a diagnostics case covering out-of-range coordinates.stack_view.stateand call it from render, keymaps, and init, removing the duplicated copies.header_lineshandling; require direction stays acyclic (modules -> state only).ui.popupsvsui.popup) with the known keys at that level.ui.title.icons.map,ui.title.context.node_types) and array / empty-table values to avoid false positives, and document the validation behaviour in the README.