yassinebridi / serpl

A simple terminal UI for search and replace, ala VS Code.
MIT License
564 stars 4 forks source link

Pressing Ecsp does not quit! #5

Closed H4ckint0sh closed 4 months ago

H4ckint0sh commented 4 months ago

I am on mac and whenever I press quit when the serpl is open inside floating terminal created by toggleterm the program does NOT quite.

EDIT: The cursor is moved to the bottom upon Escp press and then I am stuck there.

EDIT2: I need new glasses, the quit is actually c-c!

Anyways the background highlight is wrong.

Screenshot 2024-06-23 at 11 01 25 PM
yassinebridi commented 4 months ago

Hey, thanks for trying it out. Yeah, the default quit keymap is <C-c> or <C-d>, but that's configurable with config.json https://github.com/yassinebridi/serpl?tab=readme-ov-file#configuration

About the highlighting issue, i'm curious to know that also happen if you run serpl inside a normal terminal instead of floaterm

H4ckint0sh commented 4 months ago

Hey, thanks for trying it out. Yeah, the default quit keymap is <C-c> or <C-d>, but that's configurable with config.json https://github.com/yassinebridi/serpl?tab=readme-ov-file#configuration

About the highlighting issue, i'm curious to know that also happen if you run serpl inside a normal terminal instead of floaterm

That is working!:

image
yassinebridi commented 4 months ago

Yeah i figured, this is probably due to your neovim color configuration.

H4ckint0sh commented 4 months ago

Yeah i figured, this is probably due to your neovim color configuration.

I am confused as lazygit is actually working in another float so it cant be.

image
yassinebridi commented 4 months ago

Hmm, that is weird, i will try to reproduce this, would you mind posting your floatterm config.

H4ckint0sh commented 4 months ago

Hmm, that is weird, i will try to reproduce this, would you mind posting your floatterm config.

-- Require Terminal from toggleterm
local Terminal = require("toggleterm.terminal").Terminal

-- Define a new terminal with the `serpl` command
local serpl = Terminal:new({
    cmd = "serpl",
    direction = "float",
    highlights = {
        Normal = { link = "Normal" },
        NormalNC = { link = "NormalNC" },
        NormalFloat = { bg = mocha.none, fg = mocha.text},
        FloatBorder = { link = "FloatBorder" },
        StatusLine = { link = "StatusLine" },
        StatusLineNC = { link = "StatusLineNC" },
        WinBar = { link = "WinBar" },
        WinBarNC = { link = "WinBarNC" },
    },
    float_opts = {
        border = "curved",
        width = math.floor(0.7 * vim.fn.winwidth(0)),
        height = math.floor(0.8 * vim.fn.winheight(0)),
    },
    close_on_exit = true,
})

-- Function to toggle the `serpl` terminal
function _Serpl_toggle()
    serpl:toggle()
end

-- Key mapping to open the floating terminal with `serpl` command
vim.api.nvim_set_keymap("n", "<F10>", ":lua _Serpl_toggle()<CR>", { noremap = true, silent = true })
H4ckint0sh commented 4 months ago

I have find the culprit. There was a winblend set to a number bove 0 and that made it go black.

yassinebridi commented 4 months ago

That make sense, glad you found the solution!