🐻 minimal ui2 fuzzy finder for Neovim codeberg.org/comfysage/artio.nvim
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(view): prevent msg block mode

+16 -27
+16 -27
lua/artio/view.lua
··· 139 139 ---@param level integer 140 140 ---@param hl_id integer 141 141 function View:show(content, pos, firstc, prompt, indent, level, hl_id) 142 - cmdline.level, cmdline.indent, cmdline.prompt = level, indent, cmdline.prompt or #prompt > 0 142 + cmdline.level, cmdline.indent = level, indent 143 143 if cmdline.highlighter and cmdline.highlighter.active then 144 144 cmdline.highlighter.active[ext.bufs.cmd] = nil 145 145 end ··· 250 250 251 251 ext.check_targets() 252 252 253 - self.prev_show = cmdline.cmdline_show 254 - 255 253 vim.schedule(function() 256 254 self.augroup = vim.api.nvim_create_augroup("artio:group", { clear = true }) 257 255 ··· 303 301 }) 304 302 end) 305 303 306 - cmdline.cmdline_show = function(...) 307 - return self:show(...) 308 - end 309 - 304 + cmdline.prompt = false 305 + cmdline.srow = 0 310 306 cmdline.indent = 1 311 - cmdline.level = 0 307 + cmdline.level = 1 312 308 313 309 self:saveview() 314 310 ··· 339 335 if self.closed then 340 336 return 341 337 end 342 - cmdline.cmdline_show = self.prev_show 343 338 self:closepreview() 344 339 vim.schedule(function() 345 340 pcall(vim.api.nvim_del_augroup_by_id, self.augroup) ··· 399 394 400 395 function View:trigger_show() 401 396 logdebug("trigger_show") 402 - cmdline.cmdline_show( 403 - { { 0, self.picker.input } }, 404 - -1, 405 - "", 406 - self.picker.prompttext, 407 - cmdline.indent, 408 - cmdline.level, 409 - prompt_hl_id 410 - ) 397 + self:show({ { 0, self.picker.input } }, -1, "", self.picker.prompttext, cmdline.indent, cmdline.level, prompt_hl_id) 411 398 end 412 399 413 400 ---@param force? boolean ··· 469 456 end) 470 457 end 471 458 459 + local srow = 0 460 + 472 461 function View:clear() 473 - cmdline.srow = self.picker.opts.bottom and 0 or 1 474 - cmdline.erow = cmdline.srow 462 + srow = self.picker.opts.bottom and 0 or 1 463 + cmdline.erow = srow 475 464 self:setlines(0, -1, {}) 476 465 end 477 466 ··· 618 607 lines[#lines + 1] = "" 619 608 end 620 609 end 621 - self:setlines(cmdline.srow, cmdline.erow, lines) 622 - cmdline.erow = cmdline.srow + #lines 610 + self:setlines(srow, cmdline.erow, lines) 611 + cmdline.erow = srow + #lines 623 612 624 613 for i = 1, #lines do 625 614 local has_icon = icons[i] and icons[i][1] and true 626 615 local icon_indent = has_icon and (#icons[i][1] + icon_pad) or 0 627 616 628 617 if has_icon and icons[i][2] then 629 - self:mark(nil, cmdline.srow + i - 1, indent, { 618 + self:mark(nil, srow + i - 1, indent, { 630 619 end_col = indent + icon_indent, 631 620 hl_group = icons[i][2], 632 621 priority = ext_priority.icon, ··· 637 626 if line_hls then 638 627 for j = 1, #line_hls do 639 628 local hl = line_hls[j] 640 - self:mark(nil, cmdline.srow + i - 1, indent + icon_indent + hl[1][1], { 629 + self:mark(nil, srow + i - 1, indent + icon_indent + hl[1][1], { 641 630 end_col = indent + icon_indent + hl[1][2], 642 631 hl_group = hl[2], 643 632 priority = ext_priority.hl, ··· 646 635 end 647 636 648 637 if marks[i] then 649 - self:mark(nil, cmdline.srow + i - 1, indent - 1, { 638 + self:mark(nil, srow + i - 1, indent - 1, { 650 639 virt_text = { { self.picker.opts.marker, "ArtioMarker" } }, 651 640 virt_text_pos = "overlay", 652 641 priority = ext_priority.marker, ··· 656 645 if hls[i] then 657 646 for j = 1, #hls[i] do 658 647 local col = indent + icon_indent + hls[i][j] 659 - self:mark(nil, cmdline.srow + i - 1, col, { 648 + self:mark(nil, srow + i - 1, col, { 660 649 hl_group = "ArtioMatch", 661 650 end_col = col + 1, 662 651 priority = ext_priority.match, ··· 676 665 end 677 666 678 667 self:updateoffset() 679 - local row = math.max(0, math.min(cmdline.srow + (idx - offset), cmdline.erow) - 1) 668 + local row = math.max(0, math.min(srow + (idx - offset), cmdline.erow) - 1) 680 669 681 670 self:mark("hlselect", row, 0, { 682 671 virt_text = { { self.picker.opts.pointer, "ArtioPointer" } },