Matt Ellis
585b815472
Only notify changes if the value is different
...
This is primarily to avoid instantiating inactive extensions when
resetting all options back to default values, which sets extensions
inactive.
It applies to global and local options, but not to global-local. The
notifications for global-local options are already complex, as they can
be reacting to changes to both the global and local value, and only
notifying editors that are affected.
2023-09-11 11:04:09 +03:00
Matt Ellis
c37e2f4176
Update fallback window when all windows close
2023-09-11 11:04:09 +03:00
Matt Ellis
626d59d3fc
Only use fallback for first initialisation
...
Subsequent initialisation will be treated like EDIT
2023-09-11 11:04:09 +03:00
Matt Ellis
ddd058a26f
Fix name of usage statistic
2023-09-11 11:04:09 +03:00
Matt Ellis
32b8d03c5e
Improve modifying string and string list options
2023-09-11 11:04:09 +03:00
Matt Ellis
71f3e1b4f1
Support per-window global values
...
For local-to-window options
2023-09-11 11:04:09 +03:00
Matt Ellis
aa6f53fa68
Require editor when getting/setting global option
2023-09-11 11:04:09 +03:00
Matt Ellis
1335e9f7f2
Improve detection of editor open scenarios
2023-09-11 11:04:09 +03:00
Matt Ellis
c75599b6a0
Refactor editor options initialisation
2023-09-11 11:04:09 +03:00
Matt Ellis
2efdfbd988
Remove unnecessary calls from tests
2023-09-11 11:04:09 +03:00
Matt Ellis
700198d8bc
Remove test only vimscript execute method
2023-09-11 11:04:09 +03:00
Matt Ellis
3efab5928e
Evaluate ideavimrc in the fallback window context
2023-09-11 11:04:09 +03:00
Matt Ellis
93037b6866
Add fallback window to capture local option state
2023-09-11 11:04:09 +03:00
Matt Ellis
0f19e50c69
Improve hierarchy of option accessors
...
Getting the effective IJ options would allow access to Vim global and IJ global, but not Vim effective. IntelliJ specific options are now a separate hierarchy, so the Vim effective and IJ effective accessors now simply access all Vim or all IJ options.
2023-09-11 11:04:09 +03:00
Matt Ellis
66ea6ad3d4
Rename OptionScope to OptionAccessScope
2023-09-11 11:04:09 +03:00
Matt Ellis
cb8385a092
Fix issue adding back hidden status bar widget
2023-08-03 15:00:28 +03:00
Matt Ellis
d4aa1f87e0
Fix read-only stdin when running application
2023-08-03 14:58:47 +03:00
Matt Ellis
d112030a8e
Add explanatory comment about InsertExitModeAction
2023-08-01 12:22:26 +03:00
Matt Ellis
98ca4080dd
Do not enter INSERT mode for read-only editors
...
It's not enough that the document is writable, the editor needs to be non-read-only, too.
Fixes VIM-2313, fixes VIM-2318, fixes VIM-2666, fixes VIM-2951
2023-08-01 12:22:26 +03:00
Matt Ellis
dd24ebf184
Rename OptionsScope.AUTO to EFFECTIVE
2023-07-31 11:28:32 +03:00
Matt Ellis
7ef2be625f
Refactor parseOptionLine for readability
2023-07-31 11:28:32 +03:00
Matt Ellis
e3957d2207
Minor updates from code review
2023-07-31 11:28:32 +03:00
Matt Ellis
8ce1307d51
Fix tests under latest SDK
2023-07-31 11:28:32 +03:00
Matt Ellis
e1141dcd1c
Remove old option listener API
2023-07-31 11:28:32 +03:00
Matt Ellis
4e33b5f351
Migrate to effective value change listeners
2023-07-31 11:28:32 +03:00
Matt Ellis
54dc184dd0
Introduce option effective value change listener
2023-07-31 11:28:32 +03:00
Matt Ellis
1977ce3ea5
Add simple one to many collection
2023-07-31 11:28:32 +03:00
Matt Ellis
c8c9d1729e
Introduce listener for global option changes
2023-07-31 11:28:32 +03:00
Matt Ellis
e6e4b81f3b
Simplify guicursor caret attributes cache
2023-07-31 11:28:32 +03:00
Matt Ellis
1c465f028e
Fix option scopes for :let command
2023-07-31 11:28:32 +03:00
Matt Ellis
12824c22c4
Add :setglobal command
2023-07-31 11:28:32 +03:00
Matt Ellis
64c5ad72a3
Use accessor API to set global-local value
2023-07-31 11:28:32 +03:00
Matt Ellis
080c2059ee
Format unset global-local toggle options
2023-07-31 11:28:32 +03:00
Matt Ellis
a288850010
Add support for resetting option to global value
2023-07-31 11:28:32 +03:00
Matt Ellis
16811602d2
Support global-local options
2023-07-31 11:28:32 +03:00
Matt Ellis
6d94d719e3
Only notify change if option has changed
2023-07-31 11:28:32 +03:00
Matt Ellis
749d111e89
Reset options for current editor only
...
Matches Vim behaviour for `:set all&`
2023-07-31 11:28:32 +03:00
Matt Ellis
365d8d34ce
Introduce AUTO scope for effective option values
2023-07-31 11:28:32 +03:00
Matt Ellis
ced25bbf28
Initialise options when opening windows/buffers
...
Note that this temporarily changes the semantics of `:set` to always set the local option, instead of setting the global option (because we now eagerly initialise local values). Neither is correct, but we don't yet have a way to support the proper behaviour.
2023-07-31 11:28:32 +03:00
Matt Ellis
7e1ce5a203
Use Vim terminology in storage service
2023-07-31 11:28:32 +03:00
Matt Ellis
aeec754f7e
Override IjVimEditor.toString for better debugging
2023-07-31 11:28:32 +03:00
Matt Ellis
9a3fcb56a1
Support local-to-buffer options
...
Previously, all local options were treated as local-to-window
2023-07-31 11:28:32 +03:00
Matt Ellis
aff956f4c8
Update parsed value cache for declared scope
2023-07-31 11:28:32 +03:00
Matt Ellis
0f49fd6406
Introduce declared scope for all options
2023-07-31 11:28:32 +03:00
Matt Ellis
6bd1782c4b
Fix OS specific values in tests
2023-07-19 18:04:02 +03:00
Matt Ellis
2f5d402c61
Support :set! to output as a single column
2023-07-19 18:04:02 +03:00
Matt Ellis
8fb2ea5845
Output options in column order, not row order
...
This means that the last column might not be full, rather than the last row. Same as Vim.
2023-07-19 18:04:02 +03:00
Matt Ellis
a78e21a167
Use soft wraps instead of hard wraps in ex output
...
Hard wraps require figuring out the width of the panel, and all we have is the width of the associated editor, which excludes gutter, etc. Easier to let the UI toolkit handle it
2023-07-19 18:04:02 +03:00
Matt Ellis
2e9b626523
Fix formatting of value pair options
2023-07-19 18:04:02 +03:00
Matt Ellis
4487b8904c
Sort options output before formatting
...
Sorts on option name, not including "no" prefix for toggle options
2023-07-19 18:04:02 +03:00
Matt Ellis
1f01f915dc
Remove trailing padding from options list
2023-07-19 18:04:02 +03:00
Matt Ellis
94ef9692f2
Fix typo in ideajoin notification
2023-05-17 10:54:13 +02:00
Matt Ellis
798750bf95
Use options API for more cached values
2023-05-17 10:54:13 +02:00
Matt Ellis
e8d9bd551f
Add helper functions to storage service
2023-05-17 10:54:13 +02:00
Matt Ellis
d08ea2ee9b
Introduce simple cache for parsed option values
2023-05-17 10:54:13 +02:00
Matt Ellis
52dcb2d290
Treat 'iskeyword' as a local-to-buffer option
2023-05-17 10:54:13 +02:00
Matt Ellis
4cc883f174
Refactor search helper companion to interface
...
Helper functions now take the editor rather than the text, ready for search to rely on per-editor options (i.e. '`iskeyword'`). Also standardises on `Int` for search parameters. While the file size is a `Long`, the editor returns a `CharSequence`, which is indexed by `Int`.
2023-05-17 10:54:13 +02:00
Matt Ellis
5a3c5bd761
Treat 'virtualedit' as a global-local option
2023-05-17 10:54:13 +02:00
Matt Ellis
66830b7cb3
Treat 'idearefactor' as a global-local option
2023-05-17 10:54:13 +02:00
Matt Ellis
b742865e8a
Treat 'ideajoin' as a global-local option
2023-05-17 10:54:13 +02:00
Matt Ellis
fd314a3288
Treat 'matchpairs' as a local option
2023-05-17 10:54:13 +02:00
Matt Ellis
29bd7cbe6e
Update note to include how to add an option
2023-04-26 10:26:06 +03:00
Matt Ellis
a51fc9c612
Add extra notes about the history of refactorings
2023-04-26 10:26:06 +03:00
Matt Ellis
77ad9deeba
Use interface for IJ specific options
2023-04-26 10:26:06 +03:00
Matt Ellis
ffa6c45b62
Reset test injector after each test
2023-04-26 10:26:06 +03:00
Matt Ellis
957874ce2b
Remove unused @JvmField annotations
2023-04-26 10:26:06 +03:00
Matt Ellis
330d92116c
Refine inheritance of IJ specific option classes
2023-04-26 10:26:06 +03:00
Matt Ellis
899adfc1b0
More refactoring to use new API
2023-04-26 10:26:06 +03:00
Matt Ellis
23535a6ad5
Remove OptionValueAccessor
2023-04-26 10:26:06 +03:00
Matt Ellis
e8b7f00370
Remove accessor from new API
2023-04-26 10:26:06 +03:00
Matt Ellis
3f2c5070ee
Migrate local option access to new API
2023-04-26 10:26:06 +03:00
Matt Ellis
a2352525c5
Migrate global option access to new API
...
Also fixes some incorrect usages of local options as global, e.g. 'ideajoin' and 'scroll'. There are some options that should be local that are only ever accessed at global scope. These need fixing in the future, e.g. 'iskeyword', 'matchpairs' and 'virtualedit'
2023-04-26 10:26:06 +03:00
Matt Ellis
50384a526b
Introduce option accessor delegated properties
...
Also migrates tests to use new properties
2023-04-26 10:26:06 +03:00
Matt Ellis
9ade3365ff
Extract StringListOption
...
While it is conceptually very similar to StringOption, the implementation of list vs not-list operations are very different, and having a separate type will allow us to do more interesting things with overloading when we introduce delegate properties
2023-04-26 10:26:06 +03:00
Matt Ellis
f803c0aa72
Add deterministic initialisation of options
2023-03-31 17:37:48 +03:00
Matt Ellis
531b0e3537
Provide an API to override option default value
...
This is specifically to support ideaput in 'clipboard'
2023-03-31 17:37:48 +03:00
Matt Ellis
cbf6c30be6
Make option value accessor more strongly typed
2023-03-31 17:37:48 +03:00
Matt Ellis
a6f62dd837
Remove unnecessary assert
...
checkIfValueValid will check datatype is correct
2023-03-31 17:37:48 +03:00
Matt Ellis
18d52c2459
Make addListener more strongly typed
2023-03-31 17:37:48 +03:00
Matt Ellis
ee55cfd2dd
Improve handling of variance with setOptionValue
...
With the `out` modifier, the compiler won't report a problem trying to assign `VimInt` to an `Option<VimString>`
2023-03-31 17:37:48 +03:00
Matt Ellis
3ab5fc1120
Improve handling of variance
2023-03-31 17:37:48 +03:00
Matt Ellis
f7f60f5079
Fix warnings
2023-03-31 17:37:48 +03:00
Matt Ellis
b7dcff79ae
Improve modifyOptionValue
2023-03-31 17:37:48 +03:00
Matt Ellis
c857b9d6dd
Make functions private to SetCommand
2023-03-31 17:37:48 +03:00
Matt Ellis
8f8c05e451
Remove string based option helper functions
2023-03-31 17:37:48 +03:00
Matt Ellis
af3ebe60f4
Use strongly typed options instead of constants
2023-03-31 17:37:48 +03:00
Matt Ellis
be64d24c00
Introduce strongly typed properties for options
2023-03-31 17:37:48 +03:00
Matt Ellis
8f04575efd
Extract IJ specific options to own file
2023-03-31 17:37:48 +03:00
Matt Ellis
4e1b8f3ec4
Extract IJ specific options to own class
2023-03-31 17:37:48 +03:00
Matt Ellis
c8ca6671ab
Remove unused functions
2023-03-31 17:37:48 +03:00
Matt Ellis
88f0d2e532
Replace constants with strongly typed properties
2023-03-31 17:37:48 +03:00
Matt Ellis
76a4499c9f
Introduce properties for option definitions
2023-03-31 17:37:48 +03:00
Matt Ellis
e1bd790294
Add tests to ensure ideaput is added or required
2023-03-31 17:37:48 +03:00
Matt Ellis
6d193ca1f8
Extract option definitions to own file
2023-03-31 17:37:48 +03:00
Matt Ellis
d932172e70
Extract option definitions to own class
2023-03-31 17:37:48 +03:00
Matt Ellis
9bbf5824fe
Use lazy property delegate
2023-03-31 17:37:48 +03:00
Matt Ellis
d042ee3058
Move octopushandler option out of vim-engine
2023-03-31 17:37:48 +03:00
Matt Ellis
c192f319d1
Simplify setting known options a little
2023-03-10 10:17:45 +02:00
Matt Ellis
097dfa06a6
Add a couple of convenience functions
2023-03-10 10:17:45 +02:00
Matt Ellis
90ca544d0a
Move getter helpers out of the options interface
...
The interface now has a simple setter and getter, as well as other functions for managing options. More friendly functions for getting and setting values are available as extension functions
2023-03-10 10:17:45 +02:00