1769 Commits

Author SHA1 Message Date
Ingo Karkat 4a401852c9 Merge branch 'release/1.047' into stable 1.047 2025-06-10 12:04:31 +02:00
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 f14a585618 ENH: Support :mksession persistence in ingo/plugin/persistence.vim
Merge branch 'feature/session-persist'
2025-06-03 17:09:24 +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 e4d0ac1afb ENH: ingo#plugin#persistence#CanPersist() indicates the type(s) of persistence
Unfortunately, only via different positive numbers to remain compatible with the original truthy return values.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-03 17:07:32 +02:00
Ingo Karkat fc1ad456b5 ENH: Also use s:CompatibilitySerialization() for session global variables
These still are limited to numbers and strings (as of Vim 9.1.1401), so List and Dict variables need to be serialized as strings.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-03 17:07:32 +02:00
Ingo Karkat df7c8a2974 Refactoring: Minor: Extract s:GetPersistenceTypeFor()
We'll need this elsewhere soon, and it also fixes the separate check in ingo#plugin#persistence#Load().

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-03 17:07:32 +02:00
Ingo Karkat 5cedc8e7eb ingo#plugin#persistence#QueryYesNo(): ENH: Minor: Allow passing a:variableName
Since there's both viminfo and session persistence now, both of which can be configured independently, this depends on the name of variable.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-03 17:07:32 +02:00
Ingo Karkat 1271efb705 ENH: ingo#plugin#persistence#CanPersist() also considers 'sessionoptions' containing "global"
This will persist global variables that start with an uppercase letter and contain at least one lowercase letter in a Vim session created by :mksession.
It's not as encompassing as the viminfo persistence, but good enough to be counted.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-03 17:07:32 +02:00
Ingo Karkat 482f7d46f9 Refactoring: Minor: Extract l:isViminfoPersistence
System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-03 17:07:27 +02:00
Ingo Karkat 592ec1d068 Documentation: Minor: Document ingo#plugin#persistence#CanPersist()
System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1401
2025-06-03 15:02:41 +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 23f335097e Bump: Draft a new version 1.047
System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.1029
2025-02-11 12:18:48 +01:00
Ingo Karkat 83cb09e42f Merge tag '1.046'
Version 1.046
2025-01-17 15:58:22 +01:00
Ingo Karkat 938cb85785 Merge branch 'release/1.046' into stable 1.046 2025-01-17 15:58:13 +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 0c00e28311 Small fixes and API enhancements to ingo#query#fromlist#Query[AsText]()
Merge branch 'feature/querylist'
2024-12-13 14:44:17 +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 0cb9e2a857 ingo#query#fromlist#QueryAsText(): ENH: Allow returning a canned default emptyValue when a:list is empty
Syntactic sugar that saves the client from checking and defaulting a:list _and_ setting the acceptSingle flag.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.602
2024-12-13 12:33:45 +01:00
Ingo Karkat 9adf18bff8 ingo#query#fromlist#Query[AsText](): ENH: Add acceptSingle flag to directly return without query
System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.602
2024-12-13 12:30:15 +01:00
Ingo Karkat 3f0b57983a ingo#query#fromlist#Query[AsText](): FIX: a:defaultIndex cannot be selected via <Enter>
Forgot to provide an implementation; for confirm() (and my emulation in ingo#query#Confirm[AsText]()), nothing needs to be done.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.602
2024-12-13 12:26:21 +01:00
Ingo Karkat c360879b5c ingo#query#fromlist#Query[AsText](): Robustness: Return -1 if empty a:list is passed
Unless with ingo#query#Confirm[AsText](), where an empty list still presents a dialog with |OK| button, here no choices don't make sense, and the query is just confusing:
> Select stuff via [count] or (l)etter:  ?

Return -1 / empty string in that case, as if the user aborted.

System-info: Ubuntu 20.04.6 LTS, x86_64
Platform-info: Vim 9.1.602
2024-12-13 12:17:55 +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 14ba1301ae Merge tag '1.045'
Version 1.045
2024-10-03 15:27:11 +02:00
Ingo Karkat 238e1ec8e9 Merge branch 'release/1.045' into stable 1.045 2024-10-03 15:25:59 +02: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 729e716a1d surroundings: Style: Corrections 2024-04-16 17:38:44 +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 f53fe3fa63 ingo#window#preview#OpenPreview(): Robustness: Handle "E36: Not enough room" 2023-08-17 15:25:54 +02: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 622fd58722 ingo#cmdargs#command#Parse: Documentation: BUG: commandCommands and range result elements are swapped 2023-05-15 17:13:34 +02:00
Ingo Karkat 81171974ee ingo#plugin#cmdcomplete#dirforaction#setup(): ENH: Allow passing of 'commandAttributes': '-count', Funcref for a:parameters.browsefilter and a:parameters.wildignore
Merge branch 'feature/CmdCompleteDirForAction-count'
2023-05-15 17:01:56 +02:00
Ingo Karkat b7b85add3d Documentation: Update with new functionality 2023-05-15 17:01:40 +02:00
Ingo Karkat 383183c91f ENH: Allow Funcref for a:parameters.wildignore, too 2023-05-15 16:59:45 +02:00
Ingo Karkat 1bb08b5061 ENH: Allow Funcref for a:parameters.browsefilter, too 2023-05-15 16:57:27 +02:00
Ingo Karkat 22e8d52bdb Also extract the bang, count, and mods when completing 2023-05-15 16:28:22 +02:00
Ingo Karkat 635e21759c ingo#plugin#cmdcomplete#dirforaction: ENH: Allow passing of 'commandAttributes': '-count' 2023-05-15 15:55:23 +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 cb7c672860 Improve ingo#gui#position#Get()
Merge branch 'feature/getwinpos'
2023-03-16 21:48:02 +01:00
Ingo Karkat 760e8a53ad Cosmetics: Delete changelog 2023-03-16 21:46:57 +01:00
Ingo Karkat ada501a0fc Compatibility: ingo#gui#position#Get(): Use getwinpos() if available 2023-03-16 21:24:16 +01: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 097b1c729e ingo#regexp#comments#CommentToExpression(): BUG: Escaping problems with $ and special comment characters like *
Merge branch 'feature/CommentToExpression'
2022-12-30 15:34:16 +01:00
Ingo Karkat ec21111dc8 Cosmetics: Delete changelog 2022-12-30 15:34:11 +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