Since 2012, I use to view and modify almost all text files, logs and program codes in VFP / JS / Python / XML / HTML languages editors created by Alexey Torgashin: at first it was SynWrite , now its descendant CudaText . I deliberately chose his editor from the list of tested ones, which included, among others, AkelPad , Notepad ++ and Sublime Text . The responsiveness of technical support turned out to be decisive - Aleksey received a huge number of wishes / complaints from users and quickly implemented them. I will explain. The number of wishes / claims was approximately uniform all the years, and after switching to the GitHab three years ago, it became measurable and is estimated by me as 400 wishes / year and 100 bugs / year. It is pleasantly surprising that the expansion of the functionality at the request of the workers did not affect the reliability of the editor as a whole. And when the resource of sustainable development SynWrite was exhausted, CudaText appeared.
I have a conversation with Alexey on various topics. He recently listed what is missing in Sublime. It seemed to me interesting, and we agreed to present these ideas in Habré. Next will be a summary of theses from Alexei in my editing.
After spending several years creating your own program, you’re looking at the results of your competitors in another way. You notice in them not only successful features (either you have already applied them or you want to use them), but also disadvantages. I’ll show what could be improved in Sublime Text (hereafter Sublime ), if we compare it with my CudaText (hereafter Cuda ). At the same time, I emphasize that my editor appeared when Sublime was already widespread, many of his ideas were basic for Cuda :
Sublime rigidly imposes a text-team work style.
For example.
This style is effective, flexible and expandable, but requires continuous training from the user. For beginners, this creates a noticeable threshold for entry.
Cuda is trying to be a more accessible tool. This is possible because it is created in the Lazarus environment, which provides a rich GUI arsenal and portability between Win / Linux / Mac . As a result, the flexibility of json-settings in Cuda is combined with dialog-plug-ins, for example, Search by Files (there is a habr-review ), settings editor and others.
I will try to make a few ideas on how Sublime can be improved. Of course, this is just my personal opinion.
Sublime has no toolbars. This is how his text-command style is manifested. Apparently, it is assumed that the useful place for the edited code is more important. You can call all commands either from the menu, or from the Palette by name, or via hotkeys. There is a clear drawback to this approach - you need to know in advance either the name of the team, or its hot key. But the existence of the necessary team and its name is not always obvious.
Customizable, including disabled, toolbar - one of the parts that reduces the threshold of use.
Cuda has a horizontal customizable toolbar for invoking commands and a vertical sidebar for switching panels: Tree, Project, Console. The API is responsible for setting up the toolbar, that is, it is executed via a plugin. New buttons may appear in the sidebar if the plugins add new panels.
Adding a toolbar to Sublime would not break any of its previous technologies.
The sublime status bar is poor.
(1) Console Switch / Search / Replace / By File
(2) Message
(3) Encoding
(4) EOL type
(5) Tab setting
(6) Syntax
Of these six fields, only two (Encoding and EOL) can be hidden through the config, and in the Message field plugins can add / delete key = value pairs. Neither hide, nor rearrange, nor configure the remaining fields. It is especially strange that important information about the carriage (s) / allotment (s) falls inside the Message field, where it is mixed with texts from commands.
In Cuda, a user can specify the sequence, width, and alignment for the status bar fields in user.json
:
"ui_statusbar_panels": "caret,L,250|msg,L,0|lexer,L,70|tabsize,L,70"
and filling the caret
field (carriage / discharge information) can be configured separately using macro substitutions. For example, so
"ui_statusbar_no_sel": "r={y}/{count} c={xx}", "ui_statusbar_carets": "carets={carets} top/bot={y}/{y2}", "ui_statusbar_col_sel":"r={y}/{count} c={xx} s=[{sel} x {cols}]",
As a result of these settings, Cuda will display in the status bar.
Cuda also allows you to customize how long you need to show text in the Message field.
The desire of Sublime to represent everything in text form is understandable. However, the rejection of the Tree panel, which is available in all IDE and advanced text editors, is very painful. You can use a “text tree” placed in a normal tab (for example, with the Outline
plugin), but it is poorly integrated with the Sublime interface, and is not a complete replacement.
In Cuda there is a Code tree
panel for displaying the syntax elements of the active file: functions / classes / fields for program languages, tags / keys for markup languages.
Integration:
In addition, the Cuda API allows you to create a new panel with a tree and populate it. The Project Manager
plugin does just that.
For a user who is not deeply immersed in the Sublime manuals, the situation with the placement of settings / packages / plug-ins in folders looks confusing. The first step inside the newly installed editor is dumbfounded: the Preferences -- Settings
menu command opens two files, one of which (the default settings) in the title of the editor is seen as (in Win)Sublime Text 3/Packages/Default/Preferences.sublime-settings
but there is no such file or folder on the disk. In general, the logic in this focus is guessed. The default settings must be sewn into the code of the editor, and whether they will be duplicated in any file or not is at the discretion of the developer. Sublime pretends they're in the file.
In Cuda, the default settings are also protected, but there is a real file in the assemblysettings_default\default.json
in which they are duplicated and commented. The presence of such a file creates convenience not only for users, but also for plug-ins. For example, the settings editor retrieves from this file the list of options itself, comments to them, and markup for distributing options to the tree.
With packages in Sublime similar problems happen - you look for them in the Packages
and you do not find them.
Although Cuda does not have such a powerful base of additional packages, like Sublime , but the logic behind Cuda is transparent. For example, for plug-ins there is one folder py
in which you can see everything - both standard and pre-installed. For themes, there is a data/themes
folder, for snippets - data/snippets
, for lexers - data/lexlib
.
Strange situation with the Package Control
plugin. On the one hand, out of the box Sublime comes without this plugin. On the other hand, almost nothing serious can be done without him - the editor is very short without supplements. Even placing the plugin in the Preferences
menu, not in Tools--Packages
indicates its special status. Apparently, some kind of “copyright” makes it difficult to include this plugin in the Sublime assembly.
Cuda has several plugins (now 10), including Addons Manager
, included in the distribution.
Sublime has a monolithic window layout, that is, the Console and tab groups are arranged together. You can run multiple instances, but each of them will always have tabs and, perhaps, a console.
Cuda has settings and commands for displaying the Console in a separate window. This allows you to comfortably stretch it without affecting the height of the main text and, for example, place it on a second monitor. In addition, you can separate the panel with the Tree, so as not to limit the width of the main text.
By the way, Atom (or VS Code ) users would like to have floating panels, but the developers refused, citing Electron restrictions. So this could be Sublime’s advantage over direct competitors.
Sublime has over a hundred kernel settings (107 in version 3.1.1) and six additional overlapping levels to accommodate the modified values:
(1) Packages/Default/Preferences (<platform>).sublime-settings
(2) Packages/User/Preferences.sublime-settings
(3) <Project Settings>
(4) Packages/<syntax>/<syntax>.sublime-settings
(5) Packages/User/<syntax>.sublime-settings
(6) <Buffer Specific Settings>
It is easy to imagine a situation where purely manual maintenance of even a small part of 700 values ​​(100 keys on 7 levels) becomes a problem.
In Cuda, there are almost 300 kernel settings, and there are three additional levels to cover them:
(1) settings/user.json
(2) settings/lexer <syntax>.json
(3) <File Settings>
The problem is the same - too many values ​​(up to 300 * 4) must be considered. To help users there is a plugin that displays all settings at all levels in a table, which simplifies the search and editing.
Pay attention to the Section
column - the settings are assigned to the nodes of the tree. This gives additional sorting and filters. Markup for building this tree is included in the settings comments in the settings_default\default.json
file. For example, a comment
// [UI/Listbox]`
add the following options to the UI/Listbox
node. The whole tree can also be seen
For Sublime, a similar dialog is quite possible:
There are a few minor complaints that, of course, the right place is not here, but in the Sublime technical support forum. Let it be for completeness.
PgDn
/ PgUp
does not work in dialogs-lists, for example, in the Commands Palette.Char map
Set tab color...
command is in the local menu above the shortcut. The colors thus configured are saved in the session.How easy it is to give out tips!
But the above considerations, in my opinion, are not without good. If the next version of Sublime Text comes in handy, it will be fine. By the way, maybe someone will translate and transfer ideas to Skinner (Jon Skinner).
Source: https://habr.com/ru/post/427751/
All Articles