546 Commits

Author SHA1 Message Date
Ingo Karkat 7cb96efe88 Release 1.047
System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-10 12:04:22 +02:00
Ingo Karkat 3140d05256 Documentation: Changelog
System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-03 17:09:07 +02:00
Ingo Karkat c93c33f803 CHG: ingo#text#surroundings#{ChangeEnclosedText,RemoveSingleCharDelimiters}() now take an a:delimiterCharExpr
Instead of a literal a:delimiterChar.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1029
2025-02-11 12:19:28 +01:00
Ingo Karkat f10a1d775a Release 1.046
Extract the duplicated version into a script-local variable and improve the instructions a bit.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1029
2025-01-17 15:57:15 +01:00
Ingo Karkat f72e3c1ea3 Documentation: Changelog
System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.602
2024-12-13 12:36:27 +01:00
Ingo Karkat 5fb28990d2 ENH: Add ingo#version#Has()
This allows plugins to assert a compatible ingo-library version and handle a missing dependency gracefully.
There had been user complaints (latest in https://github.com/inkarkat/vim-mark/issues/46) that it's difficult to recognize what needs to be done when the library is missing.
Most users do figure it out eventually (it's documented and the issue templates highlight this as well), but still creates friction. I hope that this is a low-boilerplate solution that's working well for both producer (me) and consumers.
I'd rather have this solved declaratively by package managers, but apparently nothing of that sort has materialized, likely because plugins with dependencies are still rare.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.602
2024-11-12 11:28:44 +01:00
Ingo Karkat 9594d54f08 Release 1.045 2024-10-03 15:24:09 +02:00
Ingo Karkat ce3ef6cff6 BUG: ingo#regexp#magic#Normalize('\V[[a-S]]') only escapes the first [
Only split the fragment into collections and other elements if the [ character actually is a special character in the source magicness.
With \V, everything (except the backslash) is taken literally; we must not do translation of collections then.

Closes #3
2024-09-29 19:20:33 +02:00
Ingo Karkat 48ffe514ba ingo#text#surroundings#SurroundWith[SingleChar](): ENH: Support custom set of [back, end] motions
I need this for a DWIM change in ingosurround#SurroundWith().
2024-04-16 21:13:39 +02:00
Ingo Karkat e875602238 Add ingo#escape#EscapeExpr() 2024-01-02 21:16:50 +01:00
Ingo Karkat cc2509e31c ENH: Add ingo#actions#EvaluateWithValOrFunc() variant of ingo#actions#ExecuteWithValOrFunc()
This is useful for configurations that can either be an expression (with optional v:val) or a Funcref.
2023-12-09 22:06:35 +01:00
Ingo Karkat 69812c40b9 BUG: ingo#join#*() with a:isKeepSpace = 0 may expand a literal tab separator into space(s)
And there's a general escaping issue with literal insertion; e.g. <C-R> may be interpreted etc.
I could instead paste the expression register, but that would clobber that (and the correct positioning may be tricky).
Leverage the :substitute that is done for the a:isKeepSpace branch, and substitute with a literal NUL character (this can be inserted robustly), then use the same :substitute command to replace it with the literal separator.
2023-05-17 08:42:29 +02:00
Ingo Karkat b7b85add3d Documentation: Update with new functionality 2023-05-15 17:01:40 +02:00
Ingo Karkat 919a217acc ingo#join#lines(): Reimplementation: Use :substitute instead of :join! + cursor positioning + single-char insert
With a:isKeepSpace = 1. This might a little bit faster, but it definitely makes the join independent from 'formatoptions' from "j" (remove a comment leader) - "B" and "M" are about spaces around multibyte characters, which doesn't apply to space-constant joining via :join!.
The only use is by my AdvancedSorters.vim, which needs a neutral join (and unjoin) that does not modify the text at all.
It also uses the special join character <Nul>, which can only be inserted literally via <C-V><C-J> in insert mode; now that we're using :substitute we need to explicitly translate that into the ^@ character.
2023-04-18 22:37:30 +02:00
Ingo Karkat d99e79a448 CHG: Minor: ingo#gui#position#Get() swap the first two returned elements (so it's X-Y, too) and return numbers for elements 3 and 4
This shouldn't matter to clients as the format is unspecified.
2023-03-16 21:21:22 +01:00
Ingo Karkat a5741c71ab ingo#regexp#comments#CommentToExpression(): BUG: Special comment characters (like "*") are not properly escaped
We could use \V...\m, but our own on-demand escaper gives shorter and more developer-friendly regular expressions.

All callers agree that it's a magic pattern, and there's also no documentation that says otherwise.
2022-12-30 15:33:49 +01:00
Ingo Karkat c1ab10c4c8 ingo#regexp#comments#CommentToExpression(): BUG: The $ anchor was mistakenly escaped, but the pattern is (normal) magic
All callers agree that it's a magic pattern, and there's also no documentation that says otherwise.
2022-12-30 15:31:02 +01:00
Ingo Karkat 461680fd4b Add ingo#text#frompattern#GetNext() 2022-12-05 21:28:01 +01:00
Ingo Karkat 733339b699 ingo#subs#BraceCreation#FromList(): ENH: Add a:options.singleCharacterElementsInSquareBraces 2022-08-03 15:49:09 +02:00
Ingo Karkat 5d9c3c0649 ingo#plugin#register#Set(), ingo#plugin#register#PutContents(): ENH: Allow passing optional target register 2022-07-29 10:30:51 +02:00
Ingo Karkat 2b978dc05b ingo#plugin#historyrecall#RecallRepeat(): Also forward optional client arguments to ingo#plugin#historyrecall#Recall()
So that SubstituteRecall.vim can forward the range, depending on whether this is a normal or visual mode repeat.
2022-07-26 07:59:19 +02:00
Ingo Karkat dcb9bcadc4 ingo#buffer#{scratch,generate}#Create(): ENH: Support "pedit" as a:windowOpenCommand 2022-06-20 22:22:44 +02:00
Ingo Karkat fd57aa0b38 Add ingo#window#preview#OpenNew() 2022-06-20 22:20:51 +02:00
Ingo Karkat e86ec742bc ingo#fs#path#{Canonizalize,Equals}(): Small fixes, support a:isResolveLinks in the latter, too 2022-06-20 20:25:18 +02:00
Ingo Karkat f4a6ac329a Add ingo#option#autochdir#{Disable,Restore}() 2022-06-20 19:46:20 +02:00
Ingo Karkat 5476c56da5 Add ingo#regexp#fromwildcard#FileOrPath() variant of ingo#regexp#fromwildcard#AnchoredToPathBoundaries() 2022-06-19 22:47:57 +02:00
Ingo Karkat 439c576a22 ingo#query#fromlist#Query(): BUG: Don't add accelerators for numbers, as those interfere with the by-count selection
A queried number is always treated as [part of] a count; this actually simplifies the parsing logic a bit.
2022-06-13 22:31:32 +02:00
Ingo Karkat eb202521a6 ingo#query#confirm#AutoAccelerators(): ENH: Add optional l:reservedAccelerators argument 2022-06-13 22:28:48 +02:00
Ingo Karkat 2f1e53b379 ingo#query#fromlist#Query(): BUG: 10th, 20th, etc. entry cannot be selected by number if it is the last
Off-by-one error: Need to check for >= 10 instead of > 10.
2022-06-13 21:27:13 +02:00
Ingo Karkat 35ecb646d4 Add ingo#text#searchhighlights#GetForLine()
Taken from SearchFoldsWithoutOpening.vim
2022-06-12 23:16:30 +02:00
Ingo Karkat 8483042d43 ingo#query#fromlist#Query(): CHG: Beep and continue querying on invalid accelerator key or number
Instead of returning -1; only <Esc> or Ctrl-C abort. This results in better usability as accidental mistypes or fat-fingerings don't abort the whole command.
2022-06-12 22:27:48 +02:00
Ingo Karkat 4b6e8de843 Release 1.044 2022-04-08 20:40:22 +02:00
Ingo Karkat 24583025b8 Add ingo#convert#ToSingleLineString()
This needs to be used in place of string() when embedding a String in the right-hand side of a mapping; the existing ingo#escape#command#mapescape() would just convert to <CR>, which would still break the mapping when executed. The right way to use it is:

execute printf('map <F12> :call Foo(%s)<CR>', ingo#escape#command#mapescape(string(expr)))
2022-03-20 20:03:51 +01:00
Ingo Karkat 73f2c78749 ingo#escape#command#map[un]escape(), ingo#escape#mapping#keys(): Also convert between newline and <CR> 2022-03-20 19:57:36 +01:00
Ingo Karkat e7f9086f2b Documentation: Update changelog 2022-03-14 09:40:35 +01:00
Ingo Karkat ea5c96e5b0 Documentation: Update changelog 2022-03-13 20:38:36 +01:00
Ingo Karkat ad93f59709 ENH: Also handle 'listchars' lead and eol options when :set list 2022-03-07 08:12:51 +01:00
Ingo Karkat 793f5e4b18 ingo#print#highlighted#Line(): Use 'listchars' to render tabs and spaces, but now only if 'list' is on 2022-03-07 07:09:21 +01:00
Ingo Karkat 2056591ee8 ingo#option#listchars#Render(): ENH: Add a:options.isTextAtStart and render lead listchars option value 2022-03-06 22:50:09 +01:00
Ingo Karkat cc259ae2e9 FIX: space rendering eclipses trail 2022-03-06 22:48:41 +01:00
Ingo Karkat b96d7c4fcd ingo#option#listchars#Render(): CHG: Deprecate a:isTextAtEnd argument, use a:options.isTextAtEnd now 2022-03-06 22:29:18 +01:00
Ingo Karkat 1cfb1c18b0 ingo#option#listchars#Render(): ENH: Add a:options.tabWidth 2022-03-06 22:12:34 +01:00
Ingo Karkat 6b168681ca Documentation: Mention inclusion, add to manifest 2022-03-06 21:40:01 +01:00
Ingo Karkat 28b59bd41f ingo#area#frompattern#Get(): BUG: a:matchCount uninitialized 2022-03-05 10:32:42 +01:00
Ingo Karkat 1be8756170 ingo#{area,text}#frompattern#Get(): ENH: Use (new) matchArea / (old) replacement to add to result
This allows the predicate to actually modify what get's added; for more flexibility.
2022-03-05 10:32:01 +01:00
Ingo Karkat ab9fe6afe9 ingo#{area,text}#frompattern#Get(): ENH: Add cursorPos and additional arguments to context object 2022-03-05 09:21:49 +01:00
Ingo Karkat bae8285a72 Add ingo#cursor#IsOnWhitespace() and ingo#cursor#IsOnEmptyLine() 2022-03-03 21:04:21 +01:00
Ingo Karkat d4c6b7cca7 Add ingo#syntaxitem#HasHighlighting() from SameSyntaxMotion.vim
Originally s:IsWithoutHighlighting( synID ), but include the non-negated form.
2022-03-03 20:59:28 +01:00
Ingo Karkat e4829ffa0a ENH: ingo#query#get#[Valid]Char() takes digraphs by default
This can be disabled via a:options.isAllowDigraphs = 0. The query functions for register, mark, substitute confirm, history recall, and confirmed filter disallow that as it's not needed.
2022-02-21 11:34:00 +01:00
Ingo Karkat 23e8af0416 Add ingo#query#get#CharOrDigraph() 2022-02-21 10:30:30 +01:00