EmEditor v24.1.0 Released (Including Technical Review)

Today, we are releasing EmEditor v24.1.0.

In version 24.1, we have added support for the new context menu in Windows 11 Explorer. With Windows 11, the design of the context menu has been revamped compared to Windows 10 and earlier versions, necessitating special handling for apps to support this change. EmEditor is now compatible with the Windows 11 context menu, enabling you to directly select the Edit in EmEditor command. Additionally, when right-clicking on a folder or the background, the Find in Files with EmEditor command becomes available. To use this feature, the EmEditor tray icon must be displayed in the notification area of the taskbar, and it is supported only when running the desktop installer version on Windows 11. This feature is accessible in both the EmEditor Professional and EmEditor Free versions.

Added a shortcut to Windows 11 context menu in Explorer.

Another significant feature added in the new Professional version is the enhancement of AI capabilities. Version 24.0 introduced AI macros using the OpenAI API (hereafter abbreviated as “API”). Version 24.1 introduces an AI assisted writing feature that predicts and autocompletes what you are typing next while composing text. AI autocomplete can reduce typing effort and improve writing speed. I am writing this text using EmEditor and am personally experiencing the convenience of the AI assisted writing feature.

By default, the AI functionality is disabled. To enable this feature, you need to check the Enable AI option on the AI page of the Customize dialog box in EmEditor, and agree to allow OpenAI to process the text data within documents opened in EmEditor. Please read OpenAI’s Privacy Policy, and if you agree, click the Continue button. According to this privacy policy, data sent to the API will not be used for training OpenAI’s models.

Added the “AI” page to the “Customize” dialog box.

Next, enter your API key in the OpenAI API Key text box. If you are logged into OpenAI, you can obtain your API key here. It is recommended to store the API key in the ‘OPENAI_API_KEY‘ environment variable, but if you use the portable version of EmEditor or do not wish to share the key with other apps because you are sharing the computer, you can disable the Use “OPENAI_API_KEY” environment variable option and save the API key exclusively for EmEditor. By default, gpt-4-turbo-preview is the preferred model. It offers more accurate suggestions than gpt-3.5-turbo. For writing in foreign languages, selecting gpt-4-turbo-preview is advisable. Also, to enable this feature, you must activate the AI assisted writing option on the General page of each configuration properties. It is enabled by default for Text, Markdown, and HTML configurations.

Added the “AI assisted writing” checkbox to the “General” page of the configuration properties.

When this feature is enabled, as you type, AI will automatically predict and suggest the next text. The suggested text appears in gray by default, and you can accept the suggestion by pressing the Tab or End key. If you want to accept only part of the suggested text, press the Right arrow key for the number of characters to accept, or Ctrl+Right to accept one word. Pressing the Delete key will remove the first character of the suggested text. Pressing the Esc key or another key cancels the suggestion. Moreover, if you want to force a prediction by AI when no suggested text is displayed, or request a different suggestion, press Ctrl+Space.

Added the ability to complete a word or phrase by using the OpenAI API.

Simply opening a file in EmEditor does not call the API. It only starts calling the API when you begin typing characters. Moreover, the following conditions must all be met to utilize this functionality:

  • Running EmEditor Professional edition
  • The Enable AI option is set
  • The AI assisted writing option is set
  • Not recording or running a macro
  • The Read-only option is turned off
  • No text is selected
  • Not editing a very large file
  • Not in CSV mode
  • Not comparing files
  • The document being edited is active
  • The cursor is at the end of line
  • Have started typing characters
  • After pausing typing (about 100ms)
  • Have not pressed the Esc key to cancel a suggestion
  • Not just clicked elsewhere with the mouse or executed another command

As described above, we aim to minimize the frequency of API usage. However, using the API still incurs a fee payable to OpenAI, calculated in tokens. Each suggestion consumes about 100 tokens for input and about 10 tokens for output. According to current pricing, using the default gpt-4-turbo-preview model consumes approx. US$0.0013 per instance. Opting for gpt-3-turbo significantly reduces the cost to approx. US$0.000065 per instance. For reference, using ChatGPT Plus provided by the same company incurs a monthly fee of US$20 or more, but if you only use the API with EmEditor, you don’t need to pay for ChatGPT Plus. Using AI with EmEditor is unlikely to amount to US$20 a month, making it an economically viable option. Using the AI macro introduced in v24.0, you can ask EmEditor any free-form questions just like with ChatGPT Plus, making it possible to completely replace ChatGPT Plus with EmEditor.

Furthermore, this version responds to customer requests.

1. The hexadecimal characters used for IPv6 addresses in highlight and sorting commands were only recognized in lowercase in previous versions. This was because RFC 5952 recommends writing IPv6 addresses in lowercase. However, based on feedback from a customer indicating that both uppercase and lowercase letters may be mixed, we now support uppercase letters as well.

2. The CommitList plugin has been improved with the addition of the Delete Remote Branch command.

I hope you like EmEditor, whether you use the Professional or Free version. Please contact us or write in forums if you have any questions, feature requests, or any ideas in the future.

Thank you for using EmEditor!
Yutaka Emura

Please see EmEditor v24.0 New Features for details and screenshots.

If you use the Desktop Installer version, you can select Check for Updates on the Help menu to download the newest version. If this method fails, please download the newest version, and run the downloaded installer. If you use the Desktop portable version, you can go to the Download page to download the newest version. The Store App versions can be updated through Microsoft Store (64-bit or 32-bit) after a few days.

EmEditor was reviewed in Mado-no-mori

A Revolutionary Text Editor Assisted by Generative AI is Here! Achieved with EmEditor Macros
– An In-depth Explanation of Macro Processing! Achieve a Kansai Dialect Conversion Feature with Extreme Modification!

EmEditor v24.0.1 released

Today, we are releasing EmEditor v24.0.1.

v24.0.1 includes the following bug fixes.

  • Fixed an issue that caused the import and export settings to inadvertently copy a device ID to another computer.
  • Fixed a bug where selecting a single column without “Cell Selection Mode” enabled would not copy the right-side delimiter.
  • Fixed a bug where selecting and converting (for example, to Uppercase) a column in a CSV with invalid syntax would convert the entire line.
  • Fixed customer-reported issues (1, 2).

If you use the Desktop Installer version, you can select Check for Updates on the Help to download the newest version. If this method fails, please download the newest version, and run the downloaded installer. If you use the Desktop portable version, you can go to the Download page to download the newest version. The Store App versions can be updated through Microsoft Store (64-bit or 32-bit) after a few days.

EmEditor v24.0.0 released (including technical review)

Today, we are releasing EmEditor v24.0.0.

In the previous version, v23.1, we introduced how to use generative AI by calling OpenAI‘s API from macros. Typically, text is used as an argument for invoking generative AI, which suggests a high affinity between text editors and generative AI. When writing documents in a text editor, one of the purposes of using generative AI is to proofread the document. In this use case, you would want to easily compare the document before and after proofreading to easily decide which parts of the changed text to keep or discard. In this version, we added a “Copy to Other” command to the context menu that appears when right-clicking on the changed text while comparing documents in a split window. Selecting this will copy the changed part to the other document being compared. If you want to copy all changes in the document at once, click the “Copy All to Other” button newly added at the title part of the split window.

After the comparison is done, you may want to close unnecessary documents and keep only the needed ones. In such cases, you can now close only the document in the currently active pane by clicking the newly added [X (Close)] button or pressing Ctrl+W or Ctrl+F4.

We further developed the library’s ChatOpenAI.jsee macro example and added it to EmEditor by default under the name AI.jsee. By using the AI macro, you can perform proofreading, summarization, translation, generate images, or ask questions to AI for selected text or the entire document. When you run this macro for the first time, you will be prompted to enter your OpenAI API key. If you are logged into OpenAI, you can get your secrect OpenAI API key by visiting here. To skip entering this key in the future, please set the environment variable OPENAI_API_KEY.

In this version, we have also responded to many requests from our customers.

1. Onigmo regular expressions now support the \Q...\E syntax. This syntax allows you to disable regular expression metacharacters without needing to escape them. For example, to search for the string [a.c], the conventional regular expression would require you to escape the metacharacters "[", ".", "]" with backslashes, \[a\.c\]. In the new version, you can simply write \Q[a.c]\E, eliminating the need to escape metacharacters. Note that Boost‘s Regex has supported the \Q...\E syntax for some time.

2. We added an option to the Find Next and Find Previous commands that only matches non-overlapping strings. For example, if you search for “AA” in the string “AAAAA”, initially only the first four characters, “AAAA”, are highlighted. When you execute the Find Next (F3) command, the search position shifts one character at a time, allowing you to search through all the “AA” pairs. With this version, setting the Find only non-overlapping strings in Find Next/Previous checkbox in the Advanced dialog box makes the command operate in a way that only non-overlapping strings match, ending the search leaving the last “A” unsearched, thus aligning the highlight with the search position.

3. In EmEditor, URI and email addresses are highlighted, and we frequently receive requests to extract just those parts. In previous versions, this could be done by specifying an appropriate regular expression in the Find dialog and selecting Extract, but many of our customers are not familiar with regular expressions. In this version, you can easily extract just the URIs or email addresses by specifying options in the Extract Frequent Strings command.

4. When opening a CSV in EmEditor, the delimiter positions are automatically adjusted by default. However, very long cells can cause the column width to become very wide, making the entire CSV hard to view. In this version, we added a Maximum column width textbox to the CSV Options page of the Customize dialog, allowing you to specify the maximum column width.

5. In the previous version, EmEditor started displaying a warning message when a file opened in it was deleted by another application. In this version, you can choose whether or not to display the warning message. It can be specified on the File page of the Configuration Properties via the Prompt if file deleted checkbox.

6. Some customers have reported slow startup times for EmEditor on recent versions of Windows 11. This is primarily due to the retrieval of the Windows Clipboard History during startup. The new version has this option disabled by default, but it can be enabled on the Clipboard page of the Customize dialog.

7. The new version disables the Switch to no wrap option in the Compare Files wizard by default.

Furthermore, in this version, we have significantly optimized commands like Split a File, Combine Files, Increase Line Indent, Decrease Line Indent, achieving a speed increase of 27 to 124 times compared to v23.1, according to our tests.

As announced by Makoto Emura on his blog, starting from this version, a warning message may appear if you use EmEditor Professional on more devices than allowed by the EULA (end-user license agreement). To maintain our lower license fees and ensure fairness among customers who have purchased multiple licenses, please purchase enough licenses to follow the terms of the license.

Uninstalling EmEditor unregisters the device, allowing you to install it on a different device. You can view your registered devices here. We have unregistered all devices when v24.0.0 was released so that old devices will be unregistered. When you use EmEditor, the device will automatically be registered.

I hope you like EmEditor, whether you use the Professional or Free version. Please contact us or write in forums if you have any questions, feature requests, or any ideas in the future.

Thank you for using EmEditor!
Yutaka Emura

Please see EmEditor v24.0 New Features for details and screenshots.

If you use the Desktop Installer version, you can select Check for Updates on the Help menu to download the newest version. If this method fails, please download the newest version, and run the downloaded installer. If you use the Desktop portable version, you can go to the Download page to download the newest version. The Store App versions can be updated through Microsoft Store (64-bit or 32-bit) after a few days.

EmEditor v23.1.3 released

Today, we are releasing EmEditor v23.1.3.

v23.1.3 includes the following bug fixes.

  • Fixed a potential issue of v23.1.2 where a portion of a very large file might not be saved.

Please see EmEditor v23.1 New Features for details and screenshots.

If you use the Desktop Installer version, you can select Check for Updates on the Help to download the newest version. If this method fails, please download the newest version, and run the downloaded installer. If you use the Desktop portable version, you can go to the Download page to download the newest version. The Store App versions can be updated through Microsoft Store (64-bit or 32-bit) after a few days.

New Validation System Explained

On version 23.0.0, we introduced a registration validation system to improve the already existing registration system. Until version 24.0.0 is released, it will run in the background of EmEditor as a test of the system. On version 24.0.0, the validation system may output notifications when invalid registrations are detected.

This blog serves to be transparent about our motivations and to document how the validation system works. If we update the validation system in the future, we will also update this page.

Motivation

Currently, there is no way for us to detect a user who is sharing their license with ten other people, or those who are using their license on more devices than allowed by the EULA (end-user license agreement). We would like customers to purchase enough licenses to follow the terms of the license. This would ensure fairness among customers who have purchased multiple licenses.

Requirements

This section lists the requirements we had for the validation system.

Functional

  • The validation system should loosely enforce the device limit clause of the license. It should not sacrifice customer satisfaction, so we should not make this limit a surprise.
  • EmEditor can be used offline. Validation will not fail if your device is offline.
  • Privacy rights of users should be maintained. The collection of personal information will be opt-in.
  • It should fit into the existing registration system and not make it a new way to register. Current users should be able to register without having to learn new steps.
    • Uninstalling the app should unregister the device.
    • Users will not need to manually register again when updating to version 24.
  • Users can log in to the Emurasoft Customer Center to view devices so that devices can be unregistered outside of the app.
  • Customers who have purchased from non-2Checkout resellers will have to register the product and create a customer center account. This is because there will be no way for them to see their devices online without an account.
  • The system should be tested in the background in version 23. It should be fully in effect from version 24.

Technical

  • The system should be simple so that it is easier to maintain.
  • A machine can be identified with a machine ID.
    • We determined that the registry value
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid
      is a suitable ID.
    • EmEditor Portable can be installed on a USB, with its settings stored in the USB. The USB can be used on many machines, and the validation system would detect different machine IDs. Therefore if the app detects that it is a portable version running on a USB, registration does not occur.
  • EmEditor can be installed per-user on a multi-user machine. We must combine all EmEditor installations on the same machine as one unit to the device count.
  • There should be a way to override the limit for a given registration key, just in case.
  • A signed token containing the device info should be stored on the user’s device. This associates the current device with the device record stored in the database.
  • The system should be able to integrate a floating license system if we decide to in the future.

Output

  • You can view a list of all devices in the Registered Devices page of customer center.
  • If the device limit is reached, a notification will appear. The user can still use the app even if the device limit is exceeded.

  • If the user bought the app from a non-2Checkout reseller and has not registered the product, a notification will ask the user to register the product.

Device table

The device table is stored in our database and records all devices that were registered. Note that a History record is associated with a purchase and it is where a registration key is stored. A Device record is defined in Go as follows.

type Device struct {
    DeviceID         uuid.UUID
    UserID           int
    HistoryID        int
    MachineID        uuid.UUID
    RegistrationDate time.Time
    ValidationDate   time.Time
    InstallationType InstallationType
    Label            string
    Unregistered     bool
}

The fields are explained in the documentation for Registered Devices.

Privacy measures for label

The Label field may contain personal information. The Label device field in the Register Product dialog box defaults to {computer name} {user name}. The personal information inside the label field is not necessary for the basic functionality of the app. Therefore, we made the label field opt-in to stick to our policy of privacy by default.

Local Device token

A LocalDevice token is stored locally on the user’s device in the form of a JWT (JSON Web Token). It associates the current device with the database Device record. It also allows EmEditor to do some validation even if it is offline. The token payload is defined as follows.

type LocalDevice struct {
    DeviceID  uuid.UUID
    MachineID uuid.UUID
}

The expiration date of the token is set to the expiration date of the registration key.

Device count

This section describes how we determine how many devices you can register. This is subject to change if we change the terms of the EULA.

To calculate the number of units towards the device limit for a specific registration key, we use the following MySQL query.

SELECT count(DISTINCT MachineID) as deviceCount
FROM devices
WHERE HistoryID=? AND Unregistered=FALSE

For a given history ID, we first get all devices that are still registered. Then we count the number of unique machines. If there are multiple devices with the same MachineID, they are likely multiple per-user installations on the same machine.

The EULA allows the licensee to install EmEditor to up to two devices per license. If EmEditor is for personal use and not installed on corporate computers, the licensee can install EmEditor to five devices per license.

Registration process

There are three scenarios where registration may happen, but the first is the most likely case.

  • Most users will register through the Register Product dialog box.
  • If you updated from version 22 to 23 and above, then EmEditor would have stored your registration key but a device record would not exist. In this case, EmEditor will automatically create the device record corresponding to the registration key without any input from the user.
  • If you unregistered a device, then opened EmEditor on that device, the device will be registered automatically.

Below is a summary of what happens after the user clicks OK in the Register Product dialog box. “Client” refers to the local EmEditor app. “Server” is our backend server and database.

  1. If the app is a portable version and is running on a removable drive, registration is skipped.
  2. If a device token already exists, the client sends an unregister request to the server.
  3. The client sends a registration request to the server, which includes the registration key, machine ID, label, and installation type.
  4. The server queries deviceCount (defined in previous section) to determine if the registration key can be used to register the device. On success, a Device record is created.
  5. The client receives the device ID. Using the device ID, the client requests a local device token.
  6. The server creates and responds with the local device token. The expiration date of the token is set to the registration key expiration date. The client writes the token to local storage.

Validation process

Validation occurs every time the app is opened.

  1. If the app is a portable version and is running on a removable drive, validation is skipped.
  2. If the registration key exists in local storage but local device token does not exist, the registration process occurs first.
  3. The token integrity is checked. The actual machine ID is compared with the stored machine ID. The result is ignored if the app is running on a removable drive.
  4. A random number generator determines if the process should stop here. This is to reduce the load of requests to our server.
  5. The validation function sleeps the thread for a certain duration. This is again to reduce the request load, as we assume that macros and other automated use cases that rapidly start and close the app would only run it for a short duration.
  6. The client requests the Device data for the stored device ID.
  7. If Device.Unregistered == true, the client attempts to register the device.

Devices will be unregistered when version 24 is released

On the day that version 24 is released, all devices will be unregistered. In version 23, uninstallation did not unregister devices, so there are many devices that should be unregistered. After we unregister all devices, the devices that are in use will automatically register again.

Support

If you have any questions or feedback about the validation system, feel free to send us a message.

EmEditor v23.1.2 released

Today, we are releasing EmEditor v23.1.2.

v23.1.2 includes the following bug fixes.

  • Fixed various issues and improved the stability.

Please see EmEditor v23.1 New Features for details and screenshots.

If you use the Desktop Installer version, you can select Check for Updates on the Help to download the newest version. If this method fails, please download the newest version, and run the downloaded installer. If you use the Desktop portable version, you can go to the Download page to download the newest version. The Store App versions can be updated through Microsoft Store (64-bit or 32-bit) after a few days.

EmEditor v23.1.1 released

Today, we are releasing EmEditor v23.1.1.

v23.1.1 includes the following bug fixes.

  • Fixed a potential crash if an opened file contains invalid characters.
  • Fixed an unexpected behavior when using the BatchReplace method with the eeFindReplaceSelOnly flag while no selection exists.

If you use the Desktop Installer version, you can select Check for Updates on the Help to download the newest version. If this method fails, please download the newest version, and run the downloaded installer. If you use the Desktop portable version, you can go to the Download page to download the newest version. The Store App versions can be updated through Microsoft Store (64-bit or 32-bit) after a few days.

EmEditor v23.1.0 released (including technical review)

Today, we are releasing EmEditor v23.1.0.

In the previous version (v23.0), we introduced how to access the web page of the generated AI using macros and the built-in Web Browser in EmEditor and obtain various information and services. However, customers who have a paid API key for the generated AI site can obtain faster, higher-quality services with more stable operation by directly calling the API. To do this, the fetch function in JavaScript is used, but since this function operates asynchronously, the return value of the function may not be obtained before the macro ends. Actually, even in v23.0, it was possible to use this method if the built-in Web Browser in EmEditor was displayed, but there was a problem that async functions could not be used if the Web Browser was not displayed. In this new version (v23.1), by using the KeepRunning property, it is now possible to wait for the completion of the async function without ending the macro (EmEditor Professional only). Before calling the async function, specify the KeepRunning property as follows.


shell.KeepRunning = true;

This keeps the macro running, allowing you to obtain the return value of the async function. To end the macro after obtaining the return value of the async function, you can specify it as follows:


shell.KeepRunning = false;

This is almost equivalent to Quit() when waiting for the completion of async functions, and the macro ends immediately.

Below is a sample macro using the fetch function to utilize the OpenAI API. To run this sample macro, you need to replace {your-API-key} with your API key. When you run the following macro, it sends the question “How are you?” to the OpenAI API and displays the answer in the output bar.


#language="v8"

const apiKey = "{your-API-key}";

/**
 * Sends prompt to OpenAI and returns the response.
 * Docs: https://platform.openai.com/docs/guides/text-generation/chat-completions-api?lang=curl
 * @param {string} endpoint URL for request
 * @param {string} apiKey API key
 * @param {string} messageContent The prompt
 * @returns {string} The text content of the response
 */
async function callOpenAI(endpoint, apiKey, messageContent) {
    const response = await fetch(
        endpoint,
        {
            method: "POST",
            headers: {
                "Authorization": `Bearer ${apiKey}`,
                "content-type": "application/json",
            },
            body: JSON.stringify({
                "model": "gpt-3.5-turbo",
                "messages": [
                    {
                        "role": "user",
                        "content": messageContent,
                    }
                ],
            }),
        }
    );
    if (!response.ok) {
        alert(await response.text());
        Quit();
    }

    const responseObj = await response.json();
    if (responseObj.choices.length == 0) {
        alert("choices length is 0");
        Quit();
    }

    // Get content of first choice
    return responseObj.choices.pop().message.content;
}

async function main() {
    const endpoint = "https://api.openai.com/v1/chat/completions";
    const sPrompt = "How are you?";
    shell.KeepRunning = true;
    const response = await callOpenAI(endpoint, apiKey, sPrompt);
    OutputBar.writeln( response );
    OutputBar.Visible = true;
    shell.KeepRunning = false;
}
main();

The CharOpenAI.jsee macro example further extends this sample by displaying a popup menu of commonly used questions (“Proofread”, “Summarize”, “Look up”, “Translate”…) for the currently selected text or entire document. When a question is selected, it sends the question to the OpenAI API and displays the answer in the output bar.

Actually, I am using the CharOpenAI.jsee macro to translate and proofread while writing this blog. By combining the generated AI with a text editor, I have been able to significantly improve my work efficiency.

Another major change in v23.1 is the speed improvement when handling large files. In v23.0, changes to lines were stored in memory instead of temporary files for faster operation. However, in systems with limited memory, this could result in slowness or errors due to insufficient system memory. In v23.1, the memory-related algorithms have been revised to operate more efficiently. Additionally, when virtual memory becomes insufficient, it now uses temporary files to store data. As a result, users no longer need to worry about the size of virtual memory, and the frequency of crashes due to memory shortage has been significantly reduced. The improvements in code related to memory, as well as the use of multi-threading and the SIMD instruction set, have resulted in a speed increase of 1.51 to 41.2 times faster than v23.0 for many commands when editing huge files, including CSV files.

The Help feature now defaults to using an external browser instead of EmEditor’s built-in Web Browser, similar to v22.5 and earlier versions. Furthermore, the Help page has been added to the Customize dialog box, allowing users to change settings related to Help.

Lastly, Makoto Emura added the Completion List feature using the Language Server Protocol (LSP). To utilize this feature, the Language Server Protocol must be enabled in the Language Server page of configuration properties, and the Show completion list option is also enabled (EmEditor Professional only). Currently, only JavaScript supports this feature.

I hope you like EmEditor, whether you use the Professional or Free version. Please contact us or write in forums if you have any questions, feature requests, or any ideas in the future.

Thank you for using EmEditor!
Yutaka Emura

Please see EmEditor v23.1 New Features for details and screenshots.

This release also includes all bug fixes while developing v23.1.

If you use the Desktop Installer version, you can select Check for Updates on the Help to download the newest version. If this method fails, please download the newest version, and run the downloaded installer. If you use the Desktop portable version, you can go to the Download page to download the newest version. The Store App versions can be updated through Microsoft Store (64-bit or 32-bit) after a few days.

EmEditor Logo

EmEditor v23.1 preview

We are releasing EmEditor v23.1 preview versions for public testing. EmEditor v23.1 significantly enhanced the speed of numerous commands when editing very large files, including CSV, while also reducing crashes caused by low memory. The preview versions also include recent bug fixes. Please try the preview versions and let us know if you encounter any issues or have any feedback

Please see EmEditor v23.1 preview (23.0.901-) for the revision history.

To update: If you use the installer version, please select Customize Update Checker on the Help menu, and set the Include preview versions in order to update automatically to future preview versions. Preview versions can also be downloaded at Previous versions.