aznhe21 / actions-preview.nvim

Fully customizable previewer for LSP code actions.
GNU General Public License v3.0
365 stars 9 forks source link

Unable to get highlight_command to work on Windows #27

Closed donhn closed 5 months ago

donhn commented 6 months ago

Hi, thank you for making this extension! I'm struggling to get highlight_command to work with delta or diff_so_fancy. Here's my config:

  "aznhe21/actions-preview.nvim",
  config = function()
    local hl = require "actions-preview.highlight"
    require("actions-preview").setup {
      highlight_command = {
        hl.delta(),
        hl.diff_so_fancy(),
      },
      telescope = {
        sorting_strategy = "ascending",
        layout_strategy = "vertical",
        layout_config = {
          width = 0.8,
          height = 0.9,
          prompt_position = "top",
          preview_cutoff = 20,
          preview_height = function(_, _, max_lines)
            return max_lines - 15
          end,
        },
      },
    }
  end,

I installed delta and diff_so_fancy via scoop and I can run them in the command line. When I try to run code_actions() this is what I see: Screenshot 2024-02-06 164532

Default configuration works fine though so it's not a big deal. Thanks again!

aznhe21 commented 5 months ago

It seems that it doesn't work with cmd.exe. I confirmed the functionality when using PowerShell as per the instructions in :help shell-powershell. I will investigate if it can be made to work with cmd.exe as well.

donhn commented 5 months ago

Ah shoot, I forgot that the shell defaults to cmd.exe and not powershell. I don't think it's worth getting to work in cmd.exe, I got it working using :help shell-powershell. Thank you!

aznhe21 commented 5 months ago

Indeed, it seems challenging to make it work with cmd.exe, so I've decided not to support it. I will add this information to the README and proceed to close this issue.