feat: Auto jump forewards for the next quotes
All checks were successful
/ Release (push) Successful in 57s
All checks were successful
/ Release (push) Successful in 57s
BREAKING CHANGE: Automatically jump towards next pair if not in a pair
This commit is contained in:
parent
828c62a0a6
commit
9622219679
1 changed files with 25 additions and 28 deletions
|
@ -1,7 +1,6 @@
|
|||
--- JQuote: A Neovim plugin for cycling through quote characters
|
||||
--- @module jquote
|
||||
--- @author Jan
|
||||
--- @version 1.0.0
|
||||
--- @license MIT
|
||||
|
||||
local M = {}
|
||||
|
@ -24,7 +23,6 @@ M.options = vim.deepcopy(DEFAULT_OPTIONS)
|
|||
|
||||
--- Plugin metadata
|
||||
--- @type table
|
||||
M._version = "1.0.0"
|
||||
M._name = "jquote"
|
||||
|
||||
--- Validates if a character is one of the configured quote characters
|
||||
|
@ -78,7 +76,7 @@ local function find_quoted_string_at_cursor(line, cursor_col)
|
|||
|
||||
-- Match opening and closing quotes of same type
|
||||
if start_quote.char == end_quote.char then
|
||||
if cursor_col >= start_quote.index and cursor_col <= end_quote.index then
|
||||
if (cursor_col >= start_quote.index and cursor_col <= end_quote.index) or (cursor_col <= start_quote.index and cursor_col <= end_quote.index) then
|
||||
return start_quote.index, end_quote.index, start_quote.char
|
||||
end
|
||||
|
||||
|
@ -248,7 +246,6 @@ end
|
|||
--- @return table health_info Plugin health information
|
||||
function M.health()
|
||||
local health_info = {
|
||||
version = M._version,
|
||||
options = M.options,
|
||||
quote_chars_count = M.options.quote_chars and #M.options.quote_chars or 0,
|
||||
hotkey_configured = M.options.hotkey ~= nil,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue