mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-24 10:47:07 +08:00
fix(cpicker): set wrap opt for win
This commit is contained in:
parent
4ba1672b75
commit
2c92c0b51f
@ -1,36 +1,35 @@
|
|||||||
# cpicker.nvim
|
# cpicker.nvim
|
||||||
> A color picker for Neovim
|
|
||||||
|
> _cpicker.nvim_ is a Color Converter for neovim.
|
||||||
|
|
||||||
|
[](https://spacevim.org)
|
||||||
|
[](LICENSE)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<!-- vim-markdown-toc GFM -->
|
||||||
|
|
||||||
|
- [Install](#install)
|
||||||
|
- [Commands](#commands)
|
||||||
|
- [Feedback](#feedback)
|
||||||
|
|
||||||
|
<!-- vim-markdown-toc -->
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
Using vim-plug
|
||||||
|
|
||||||
```
|
```
|
||||||
Plug 'wsdjeg/cpicker.nvim'
|
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
|
-- https://zenn.dev/kawarimidoll/articles/a8ac50a17477bd
|
||||||
|
|
||||||
local function copy_color()
|
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
|
if from then
|
||||||
vim.fn.setreg('+', string.sub(vim.fn.getline('.'), from, to))
|
vim.fn.setreg('+', string.sub(vim.fn.getline('.'), from, to))
|
||||||
notify.notify('copied:' .. 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', {
|
vim.api.nvim_set_option_value('bufhidden', 'wipe', {
|
||||||
buf = bufnr,
|
buf = bufnr,
|
||||||
})
|
})
|
||||||
vim.api.nvim_set_option_value('wrap', false, {
|
|
||||||
buf = bufnr,
|
|
||||||
})
|
|
||||||
vim.api.nvim_set_option_value('number', false, {
|
vim.api.nvim_set_option_value('number', false, {
|
||||||
buf = bufnr,
|
buf = bufnr,
|
||||||
})
|
})
|
||||||
@ -181,6 +185,9 @@ M.picker = function(formats)
|
|||||||
vim.api.nvim_set_option_value('number', false, {
|
vim.api.nvim_set_option_value('number', false, {
|
||||||
win = winid,
|
win = winid,
|
||||||
})
|
})
|
||||||
|
vim.api.nvim_set_option_value('wrap', false, {
|
||||||
|
win = winid,
|
||||||
|
})
|
||||||
vim.api.nvim_set_option_value('winhighlight', 'NormalFloat:Normal,FloatBorder:WinSeparator', {
|
vim.api.nvim_set_option_value('winhighlight', 'NormalFloat:Normal,FloatBorder:WinSeparator', {
|
||||||
win = winid,
|
win = winid,
|
||||||
})
|
})
|
||||||
|
@ -71,3 +71,5 @@ Plug 'wsdjeg/git.vim'
|
|||||||
## Feedback
|
## Feedback
|
||||||
|
|
||||||
The development of this plugin is in [`SpaceVim/bundle/git.vim`](https://github.com/SpaceVim/SpaceVim/tree/master/bundle/git.vim) directory.
|
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…
x
Reference in New Issue
Block a user