mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:20:05 +08:00
fix(cpicker): set wrap opt for win
This commit is contained in:
parent
4ba1672b75
commit
2c92c0b51f
@ -1,36 +1,35 @@
|
||||
# cpicker.nvim
|
||||
> A color picker for Neovim
|
||||
|
||||
> _cpicker.nvim_ is a Color Converter for neovim.
|
||||
|
||||
[![](https://spacevim.org/img/build-with-SpaceVim.svg)](https://spacevim.org)
|
||||
[![GPLv3 License](https://img.spacevim.org/license-GPLv3-blue.svg)](LICENSE)
|
||||
|
||||
![cpicker](./img/cpicker.png)
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
- [Install](#install)
|
||||
- [Commands](#commands)
|
||||
- [Feedback](#feedback)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
## Install
|
||||
|
||||
Using vim-plug
|
||||
|
||||
```
|
||||
Plug 'wsdjeg/cpicker.nvim'
|
||||
|
||||
```
|
||||
|
||||
## Usage
|
||||
## Commands
|
||||
|
||||
```
|
||||
:Cpicker rgb hsl
|
||||
```
|
||||
1. `:Cpicker`: open the color converter
|
||||
2. `:CpickerCursorForeground`: open the color converter with cursor highlight
|
||||
3. `:CpickerColorMix`: open the color mixer
|
||||
|
||||
## Feedback
|
||||
|
||||
The development of this plugin is in [`SpaceVim/bundle/cpicker.nvim`](https://github.com/SpaceVim/SpaceVim/tree/master/bundle/cpicker.nvim) directory.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If you encounter any bugs or have suggestions, please file an issue in the [issue tracker](https://github.com/SpaceVim/SpaceVim/issues)
|
||||
|
@ -86,7 +86,14 @@ end
|
||||
-- https://zenn.dev/kawarimidoll/articles/a8ac50a17477bd
|
||||
|
||||
local function copy_color()
|
||||
local from, to = vim.regex(table.concat(vim.tbl_map(function(t) return t[2] end, color_code_regex), '\\|')):match_str(vim.fn.getline('.'))
|
||||
local from, to = vim
|
||||
.regex(table.concat(
|
||||
vim.tbl_map(function(t)
|
||||
return t[2]
|
||||
end, color_code_regex),
|
||||
'\\|'
|
||||
))
|
||||
:match_str(vim.fn.getline('.'))
|
||||
if from then
|
||||
vim.fn.setreg('+', string.sub(vim.fn.getline('.'), from, to))
|
||||
notify.notify('copied:' .. string.sub(vim.fn.getline('.'), from, to))
|
||||
@ -141,9 +148,6 @@ M.picker = function(formats)
|
||||
vim.api.nvim_set_option_value('bufhidden', 'wipe', {
|
||||
buf = bufnr,
|
||||
})
|
||||
vim.api.nvim_set_option_value('wrap', false, {
|
||||
buf = bufnr,
|
||||
})
|
||||
vim.api.nvim_set_option_value('number', false, {
|
||||
buf = bufnr,
|
||||
})
|
||||
@ -181,6 +185,9 @@ M.picker = function(formats)
|
||||
vim.api.nvim_set_option_value('number', false, {
|
||||
win = winid,
|
||||
})
|
||||
vim.api.nvim_set_option_value('wrap', false, {
|
||||
win = winid,
|
||||
})
|
||||
vim.api.nvim_set_option_value('winhighlight', 'NormalFloat:Normal,FloatBorder:WinSeparator', {
|
||||
win = winid,
|
||||
})
|
||||
|
@ -71,3 +71,5 @@ Plug 'wsdjeg/git.vim'
|
||||
## Feedback
|
||||
|
||||
The development of this plugin is in [`SpaceVim/bundle/git.vim`](https://github.com/SpaceVim/SpaceVim/tree/master/bundle/git.vim) directory.
|
||||
|
||||
If you encounter any bugs or have suggestions, please file an issue in the [issue tracker](https://github.com/SpaceVim/SpaceVim/issues)
|
||||
|
Loading…
Reference in New Issue
Block a user