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.

EmEditor v23.0.5 released!

Today, we are releasing EmEditor v23.0.5.

v23.0.5 includes the following bug fixes.

  • Fixed a potential crash when a CSV file is opened while the Character Code at Cursor is enabled on the status bar
  • Fixed a potential crash when the scroll bar minimap is displayed while the CSV validation is running.
  • Fixed a potential crash on the Indent command during the vertical selection mode while multiple selections were disabled.
  • Fixed a potential crash on the CommitList plug-in with Unicode path.
  • Fixed various Help issues (1).

Please see EmEditor v23.0 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.0.4 released!

Today, we are releasing EmEditor v23.0.4.

v23.0.4 includes the following bug fixes.

  • The new version always closes the Web Browser completely when it becomes hidden.
  • Worked around a crash if running on an old CPU not supporting SSE4.2 (for instance, Intel Core 2 Duo released in 2006). The crash was due to a bug in Visual Studio v17.8.
  • Fixed the Find Keyword (Help) command on the Macros menu.
  • Fixed an issue where selecting multiple cells, press F2 or Enter, and typing changed the cell contents to a same string.
  • Fixed an issue where pressing ESC during the CSV cell editing mode did not always reset the cells.
  • Fixed a potential crash on the Combine Columns command with certain options.
  • Fixed a potential crash on the Split a File command if run during the CSV syntax check.
  • Fixed a potential crash while showing hover tooltips using the Language Server Protocol.

Please see EmEditor v23.0 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 Logo

Known Issues and Current Status

This page contains important information regarding the current version issues and their status. The information is being updated frequently.

Some issues might be already fixed in recent versions including preview versions. Please try updating EmEditor to the latest version including preview versions if you believe there are any issues.

Version 23.0.3

  • EmEditor may crash as STATUS_ILLEGAL_INSTRUCTION if running on an old CPU not supporting SSE4.2 (for instance, Intel Core 2 Duo released in 2006). The crash was due to a bug in Visual Studio v17.8. The issue was addressed on the latest version.

Version 23.0.2

  • EmEditor may not be able to save workspaces, wrap lines, or show outlining if Keep Locked is selected from the Changed by Another Program drop-down list in the File page of configuration properties. This issue was fixed on the latest version.

Version 23.0.1

  • Macros might stop working by default. To work around this issue, clear the Run macros asynchronously by default option, or set the Use V8 as JavaScript engine option in the Customize Macros dialog. This issue was fixed on the latest version.

All Versions

  • Starting with v23.0.0, the local Help format was transitioned from a single CHM file to multiple HTML files, and the Help will be displayed in a web browser. The Help pages are local if the URL is a local path.
  • If EmEditor crashes when you deal with a very large file, incrasing the virtual memory might prevent the crash. Please see How to Increase Virtual Memory. You could also avoid this problem by reducing the Number of Threads in the Advanced page of the Customize dialog. On v23.0 or later, you could also avoid this problem by setting the Use temporary files while editing option in the Advanced page of the Customize dialog, but it will lower the speed.
  • Pressing the Hankaku/Zenkaku key on a Japanese keyboard might cause EmEditor to crash. This is a bug of Windows. If this issue persists, please revert to a previous version of an IME.

EmEditor v23.0.3 released!

Today, we are releasing EmEditor v23.0.3.

v23.0.3 includes the following bug fixes.

  • Fixed issues where EmEditor might not be able to save workspaces, wrap lines, or show outlining if Keep Locked is selected from the Changed by Another Program drop-down list in the File page of configuration properties.
  • Fixed various crashes.

Please see EmEditor v23.0 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.0.2 released!

Today, we are releasing EmEditor v23.0.2.

v23.0.2 includes the following bug fixes.

  • Fixed a bug where macros may not run on default settings. The new version limits one single Web Browser even if multiple group windows exist.

Please see EmEditor v23.0 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.0.1 released!

Today, we are releasing EmEditor v23.0.1.

v23.0.1 includes the following bug fixes.

  • Fixed a bug where EmEditor could crash when opening a file as a specific file encoding such as Arabic or US-ASCII.
  • Fixed a bug where EmEditor could crash when showing the Web Browser bar in multiple group windows.

Please see EmEditor v23.0 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.0.0 released (including technical review)!

Today, we are releasing EmEditor v23.0.0.

While conventionally, this version should be named v22.6, due to numerous changes and being a truly major update, as well as being the last major update of the year, we decided to align with the last two digits of the year 2023 and name it v23.0.

Recent advancements in generative AI, including ChatGPT, have enabled the use of various information and services through web browsers. Among EmEditor users including this customer, there is a growing demand to use these web services directly within EmEditor, eliminating the need to use external browsers. In the new version, we have added a feature to display a web browser in a customer bar of EmEditor. This browser is designed to work in conjunction with macros, allowing users to send a portion of the document in the editor to a site displayed in the Web Browser or vice versa. To utilize these features, ensure that Use V8 as the JavaScript engine is selected in the Options page of the Customize Macros dialog, or add the following line at the beginning of each macro:


#language = "V8"

Two specific features have been added:

(1) web. keyword: To access the Document Object Model (DOM) of HTML, use the lowercase web. keyword. This distinction is necessary to differentiate between objects in EmEditor and objects in the Web Browser. For example, in a macro:


document.write( "Test" );

It is unclear whether “Test” should be displayed in the editor view of EmEditor or in the HTML of the Web Browser. To display “Test” in the Web Browser, add the web. prefix:


// Displays "Test" in Web Browser
web.document.write( "Test" );

With this syntax, keywords starting with web. are interpreted as instructions executed in the Web Browser, allowing access to the DOM. Examples include:


// Returns the URL of the current web page.
alert( web.location.href );

// Returns the preferred language of the browser.
alert( web.navigator.language );

// Pastes the text of the current web page into a new document.
editor.NewFile();
write( web.document.documentElement.innerText );

// Pastes the HTML of the current web page into a new document.
editor.NewFile();
write( web.document.documentElement.outerHTML );

(2) onLoad event: If the last executed macro contains a function starting with function onLoad(), it is called only once when the web page is updated or a new page is loaded. This functionality allows tasks such as retrieving search results on search sites. For example:


function onLoad() {
    // Retrieves the HTML of the page and pastes it into a new document.
    editor.NewFile();
    document.write( web.document.documentElement.outerHTML );  
}

The Bing.jsee macro example demonstrates how to retrieve and display specific information from HTML search results. Note that some search sites, like the free version of ChatGPT, may not trigger page updates or new page loads. In such cases, the onLoad() event does not occur, preventing the retrieval of search results using this event. Nevertheless, Makoto Emura came up with an idea to monitor an HTML element using the MutationObserver interface and retrieve the text when changes occur. The ChatGPT.jsee macro sample demonstrates how to retrieve responses from ChatGPT using this interface. If you run this macro as it is, the selected text is only entered into the ChatGPT prompt box. However, if you uncomment lines 99 to 100, it will actually send the text. Disclaimer: The format of Bing and ChatGPT responses may change at any time in the future, potentially affecting the functionality of these macros. The macros are intended solely to demonstrate the new features of EmEditor v23.0. We do not guarantee that these macros will work in the future.

Another major change in v23.0 is the optimization for handling large files. EmEditor users often deal with large CSV files, sometimes reaching several gigabytes. To ensure smooth performance even with such files, extensive testing was conducted on operations such as deleting, inserting, combining, sorting, and pasting columns. The commands were optimized by multi-threading and other optimization techniques, resulting in approximately 21 to 34 times faster performance compared to v22.5.

In the CSV Converter, previous versions lacked multi-threading code, causing slow performance with large files. The new version improves this by using multi-threading and SIMD code, making CSV format conversion even for multi-gigabyte files operate within a few seconds.

For Japanese (JIS) and Japanese (EUC), v23.0 abandons the use of the traditional Windows API object, MultiLanguage, in favor of a custom lookup table. This change enhances the detection logic for invalid characters and significantly improves the operation speed such as file opening and searching.

In v22.5, clicking the left edge of line numbers toggles the bookmark. Responding to user feedback, an option to disable this feature has been added in the Mouse page of the Customize dialog under Click the left edge of a line number to toggle the bookmark.

The Markdown configuration has been improved to allow more accurate representation of emphasis formatting, such as bold and italic, through the addition of special syntax.

Using the Language Server Protocol, Makoto Emura added a feature to format the selected string or entire document. This command, accessible through the Convert menu as Format (shortcut: Ctrl+K, F), eliminates inconsistencies such as the number of leading tabs or spaces and the position and presence of spaces around parentheses () or {} for improved readability. Users can select code to format, and if no selection is made, a dialog prompts whether to format the entire document. Or you may press Ctrl+K, D to format the entire document. To enable the Format command, the Language Server Protocol option must be enabled on the Language Server page of the Customize dialog box, and the desired language must be selected from the Document type drop-down list. Note that preferences for formatting, such as the presence of spaces around parentheses, depend on the language server and cannot be customized within EmEditor.

Starting from this version, the Language Server Protocol is officially supported for C++, CSS, HTML, JavaScript, JavaScript for EmEditor, Perl, and Python configurations. Users can disable this feature at any time in the settings on the Language Server page of the Customize dialog box.

Makoto enhanced the CommitList (Git) plugin by adding an Update Submodule option to pull changes to a submodule. He also removed the Undo Changes menu item from the staged files list (not unstaged files) in the CommitList sidebar to avoid confusion regarding expected behavior.

Finally, the traditional help system, which used an outdated design and was challenging to maintain, has been redesigned using Sphinx. The new help system is maintained and built on our GitHub page.

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.0 New Features for details and screenshots.

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

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.