Skip to content

I20220119-0540

@trancexpress trancexpress tagged this 19 Jan 10:11
Add new preferences (General -> Editors -> Large File Associations) to
allow fine-grained control over which editor is used when opening a
large document.

Large file limit preference stored per file type, the value of the
preference lists pairs of file size limit and associated editor ID. The
value 'largeFileLimits_prompt' can be used to indicate the user should
be prompted with a dialog to select an editor.

In addition, the preferences 'largeFileLimits_default_value' and
'largeFileLimits_default_enabled' can be set to specify default behavior
for all document types, which don't have a specific preference set.

The new preferences can be set via plug-in customization e.g. as
follows:

# all types with a preference, needed by the preference page UI
org.eclipse.ui.workbench/largeFileLimits_types=java,xml,txt
org.eclipse.ui.workbench/largeFileLimits_disabled=cpp

# if file size is over 8 MB, show prompt for all types that don't have a
preference
org.eclipse.ui.workbench/largeFileLimits_default_value=8388608
org.eclipse.ui.workbench/largeFileLimits_default_enabled=true

# Example limits per file type
org.eclipse.ui.workbench/largeFileLimits.java=4096,org.eclipse.ui.DefaultTextEditor,8192,largeFileLimits_prompt
org.eclipse.ui.workbench/largeFileLimits.xml=1048576,org.eclipse.ui.DefaultTextEditor,77777,Emacs
org.eclipse.ui.workbench/largeFileLimits.txt=2048,largeFileLimits_prompt

Note: if the old preference 'LARGE_DOC_SIZE_FOR_EDITORS' is set (single
global limit for all file types/editors), it effectively disables new
preferences for compatibility reasons.

Change-Id: Ifa2b78eeb45ec977dbcbdddee0dd3c81995480ae
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/188915
Tested-by: Platform Bot <platform-bot@eclipse.org>
Assets 2
Loading