Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#761 closed enhancement (fixed)

Make cutoff size for PPI Experimental lexer user-configurable

Reported by: misterwhipple Owned by:
Priority: minor Milestone:
Component: editor Version: 0.50
Keywords: syntax highlighting preferences Cc:

Description

If a perl document exceeds a fixed size, Padre will fall back on the Scintilla syntax highlighter, disregarding the setting in Edit->Preferences->Files and Colors->Highlighter. This is by design, as the PPI highlighting can be slow with large documents.

This caused me some confusion when I couldn't see any difference among the various highlighters' effects and didn't know why. It turned out to be because I was editing a "large" file. (The PPI Standard setting's Description says "Big file will fall back to Scintilla highlighter", but PPI Experimental does not mention this feature.)

The cutoff size is hard-coded at 4000 characters in Padre::Document::Perl.pm. I propose making the cutoff value a user preference. My rationale is that different computers will bear the extra load of PPI highlighting with varying degrees of grace, and users' perceptions of acceptable slow-down will also vary.

In the interim, a quick fix would be to tweak the Description text for the PPI Standard and PPI Experimental highlighters so that both of them mention the fallback feature, and so they explicitly state the hard-coded cutoff size, in place of the current phrase "Big file". (This text is defined in Padre::MimeTypes?.pm.)

Change History (2)

comment:1 Changed 4 years ago by adamk

  • Resolution set to fixed
  • Status changed from new to closed

Implemented in Advanced Preferences

comment:2 Changed 4 years ago by azawawi

The name of the configuration variable is perl_ppi_lexer_limit.

Note: See TracTickets for help on using tickets.