@@ -34,6 +34,7 @@ local perf_update = PerfTimer("[FileHistoryPanel] update")
3434--- @field render_data RenderData
3535--- @field option_panel FHOptionPanel
3636--- @field option_mapping string
37+ --- @field help_mapping string
3738--- @field components CompStruct
3839--- @field constrain_cursor function
3940local FileHistoryPanel = oop .create_class (" FileHistoryPanel" , Panel .__get ())
@@ -125,18 +126,18 @@ end
125126
126127function FileHistoryPanel :setup_buffer ()
127128 local conf = config .get_config ()
128- local option_rhs = config .actions .options
129129 local default_opt = { silent = true , nowait = true , buffer = self .bufid }
130130
131131 for _ , mapping in ipairs (conf .keymaps .file_history_panel ) do
132- local lhs , rhs = mapping [2 ], mapping [3 ]
133132 local opt = vim .tbl_extend (" force" , default_opt , mapping [4 ] or {}, { buffer = self .bufid })
134133 vim .keymap .set (mapping [1 ], mapping [2 ], mapping [3 ], opt )
135-
136- if rhs == option_rhs then
137- self .option_mapping = lhs
138- end
139134 end
135+
136+ local option_keymap = config .find_option_keymap (conf .keymaps .file_history_panel )
137+ if option_keymap then self .option_mapping = option_keymap [2 ] end
138+
139+ local help_keymap = config .find_help_keymap (conf .keymaps .file_history_panel )
140+ if help_keymap then self .help_mapping = help_keymap [2 ] end
140141end
141142
142143function FileHistoryPanel :update_components ()
0 commit comments