Skip to content

[REGRESSION] Switch back to UDL doc and type something makes syntax highlighting messed #16309

@donho

Description

@donho

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

While opening a Prolog UDL file then open a new document, set it to markdown UDL, switching back to Prolog UDL doc and type something makes syntax highlighting mess.

Steps To Reproduce

Content of prolog file:

:- use_module(library(http/http_open)).
:- use_module(library(http/json)).
:- use_module(library(listing)).

:- dynamic(country_location/2).

latlong_from_google(Name,
loc( FA, j^p
	       box(Bound_NELat, Bound_NELong, Bound_SWLat, Bound_SWLong),	
	       pair(Loc_Lat, Loc_Long),
		box(View_NELat, View_NELong, View_SWLat, View_SWLong)
	      )) :-
	atom_codes(AName , Name),
	www_form_encode(AName , FEName),
	atom_concat('http://maps.googleapis.com/maps/api/geocode/json?address=',
		    FEName , PreReq),
	atom_concat(PreReq, '&sensor=false', Req),
	http_open(Req, Stream, []),
  % read_stream_to_codes(In , Codes),
    json_read(Stream , Term),
    close(Stream),
    json([results=Results,status='OK']) = Term,
   [json([address_components=_AC, formatted_address=FA,   geometry=GEO,types=_TYPES])] = Results,
   json(
     [ =(bounds,
         json(
              [ northeast=json([lat= Bound_NELat, lng=Bound_NELong]),			
                southwest=json([lat= Bound_SWLat, lng=Bound_SWLong])
              ])),
       location=json([lat= Loc_Lat, lng=Loc_Long]),
       location_type=_,
       =(viewport,
         json(
              [ northeast=json([lat= View_NELat, lng=View_NELong]),
                southwest=json([lat= View_SWLat, lng=View_SWLong])
              ]))
     ]) = GEO.
 %  portray_clause(GEO),nl.

write_loc(loc( FA,
	       box(Bound_NELat, Bound_NELong, Bound_SWLat, Bound_SWLong),
	       pair(Loc_Lat, Loc_Long),
		box(View_NELat, View_NELong, View_SWLat, View_SWLong)
	      )) :-
 format('~w,~f,~f,~f,~f,~f,~f,~f,~f,~f,~f~n',
	[FA, Bound_NELat, Bound_NELong, Bound_SWLat, Bound_SWLong,	
	 Loc_Lat, Loc_Long,
	 View_NELat, View_NELong, View_SWLat, View_SWLong]).


assert_capital_locations :-
	retractall(country_location(_,_)),		
	open('countrynames.csv' , read , Stream),
	repeat,
	read_line_to_codes(Stream , Name),
	(   Name = end_of_file ->
	    true
	;
	    latlong_from_google(Name, Loc),
	    asserta(country_location(Name, Loc)),
	    write_loc(Loc),
	    fail
	),
	close(Stream).
  1. Download & install the prolog UDL: https://github.com/notepad-plus-plus/userDefinedLanguages/blob/master/UDLs/Prolog-GNU_byDanielDiaz.xml
  2. Copy & paste the above Prolog content on a new document, set it to Prolog UDL.
  3. Open a new document, set it to markdown UDL
  4. Switch back to Prolog UDL doc, and type something just after [ northeast=json([lat= Bound_NELat, lng=Bound_NELong]),

Current Behavior

The syntax highlighting is messed

Expected Behavior

The syntax highlighting should not be messed

Debug Information

Notepad++ v8.7.8   (64-bit)
Build time : Mar 19 2025 - 17:00:03
Path : C:\sources\notepad-plus-plus\PowerEditor\visual.net\x64\Debug\Notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
Placeholders : OFF
Scintilla Rendering Mode : SC_TECHNOLOGY_DEFAULT (0)
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : OFF
OS Name : Windows 11 Home (64-bit)
OS Version : 24H2
OS Build : 26100.3476
Current ANSI codepage : 1252
Plugins : 
    Python Indent (1.0.0.5)

Anything else?

This regression was introduced by de9ffd2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions