11 Commits

Author SHA1 Message Date
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 bbca74dbb0 FIX: Undefined variables and other problems in ingo#plugin#persistence#Remove() 2019-02-04 16:36:18 +01:00
Ingo Karkat 4a3ce94e83 Add ingo#plugin#persistence#QueryYesNo()
To allow plugins to consistently query simple yes/no questions with persistence options.
2019-02-04 14:55:34 +01:00
Ingo Karkat b516284612 Add ingo#plugin#persistence#{Add,Remove}()
These convenience variants of ingo#plugin#persistence#Store() make adding or removing items from a List or Dict easier (especially in light of the compatibility serialization). It's common that plugins configure a List or Set of values.
2019-02-04 12:10:50 +01:00
Ingo Karkat 96d939a5c9 Add ingo/plugin/persistence.vim module; implementation based on my mark.vim plugin 2019-02-04 09:18:21 +01:00