feat: add flexible layout customization with dynamic positioning#69
Conversation
Allows users to position the input prompt at 'top' or 'bottom' of the picker window. When prompt is at top, best matches appear at the top (closest to prompt). When prompt is at bottom (default), best matches appear at the bottom. - Add prompt_position config option with validation - Adapt list rendering order based on prompt position - Fix cursor navigation to work correctly with both layouts - Optimize array reversal for better performance - Extract helper function to reduce code duplication
Move width/height into layout namespace for better organization. Adds max_threads field and reorganizes config hierarchy to be more intuitive and extensible. BREAKING CHANGE: config.width/height moved to config.layout.width/height
Replace hardcoded deprecation handling with rule-based system for easier maintenance. Each deprecation is now defined as a simple rule with old_path, new_path, and message. Enables easy addition of future config deprecations without touching core migration logic.
Replace repetitive inline pcall functions with centralized utilities in fff.utils. Eliminates code duplication and improves error handling consistency across dynamic configuration resolution.
Implement structured deprecation rules for configuration migration, enabling smooth transition from legacy config options while maintaining backward compatibility and clear user warnings.
Document all supported preview positions (left, right, top, bottom) and preview_size parameter, removing outdated limitation claims and ensuring configuration examples match current capabilities.
Document complete configuration API including dynamic functions, all preview settings, logging, frecency, UI options, and automatic migration system. Ensures users understand both static and responsive configuration patterns.
Standardize comment alignment across configuration examples in README.md and doc/fff.nvim.txt to create consistent visual structure and make configuration options easier to scan and understand.
Standardize comment alignment across all code blocks in both README.md and doc/fff.nvim.txt including configuration examples, method calls, and keymap examples for consistent visual structure and readability.
Standardize comment alignment for better readability and consistency across README and generated vimdoc files.
…sitions Resolves inconsistent window positioning that caused preview windows to be misaligned or hidden in certain layout combinations (e.g., prompt_position='top' with preview_position='bottom'). Standardizes the coordinate calculation logic to ensure proper alignment and separation between windows for all four preview positions while maintaining the original +3 border/separator spacing.
|
for the input bottom or top we should make a rust change to return the correctly ordered list, if you put preview on the top the top match should be on the top, currently we are getting already sorted list from rust |
This should be fixed with 099aa20. |
🙈 I'll take a look later today and ensure that it works as intended! |
Fixes cursor positioning calculation to properly highlight the selected item when using bottom prompt layout. The cursor line calculation now accounts for the inverted display order in bottom mode.
|
@dmtrKovalenko Should be good to go now. |
# Conflicts: # lua/fff/main.lua # lua/fff/rust/file_picker.rs
|
I think now the selection is broken it shows one file but opens completely different one. We should probably already write some end to end tests becuase it is becoming hard to maintain all the edge cases |
|
@dmtrKovalenko Do you have any suggestions on how you would like to setup these end to end tests? |
|
I'll fix this branch myself and will add some tests later, thanks. I think we need a little bit restructuring and preparation to implement pagination |
|
I'm half way there already |





Summary
Adds configurable layout positioning for the preview panel and prompt. Preview can be positioned left, right, top, or bottom, or disabled entirely. Prompt can be at top or bottom. Layout options support both static values and functions for dynamic sizing based on terminal dimensions.
Changes
Test Plan
preview.enabled = false)Backward Compatibility
Existing configurations work unchanged. Deprecated options are automatically migrated with warnings guiding users to the new structure.