Skip to content

Reloaded buffers are not properly lexed until refocused #11606

@rdipardo

Description

@rdipardo

Description of the Issue

As first reported in #11585, reloading a buffer in Notepad++ 8.4 makes the syntax highlighting become erratic or disappear completely. If the style is provided by UDL, as with Markdown, highlighting is more likely to completely disappear. Builtin lexers are more likely to apply the wrong styles and fail to detect fold levels.

In all cases, the problem is corrected by switching focus to another buffer, then switching back.

This affects all build types of release version 8.4 (32- and 64-bit).

Steps to Reproduce the Issue

  1. Open any file in a supported language. Do not edit anything.
  2. Select File > Reload from Disk, or press Ctrl+R
  3. See examples below of what to expect
  4. Open a second buffer and switch focus to it
  5. Switch back to the first buffer
  6. The first buffer is now properly lexed

Examples

Markdown

npp_840_mrkd

JSON

npp_840_json

C / C++ / C# / JavaScript / Objective-C

npp_840_cpp

Expected Behavior

Reloaded buffers should be lexed immediately with correct styles and fold levels.

Actual Behavior

Syntax highlight is temporarily missing or incorrect after the buffer is reloaded from disk.

Debug Information

Notepad++ v8.4 (64-bit)
Build time : Apr 20 2022 - 03:31:06
Path : C:bin\npp_8.4.0\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 11 (64-bit)
OS Version : 2009
OS Build : 22000.651
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions