Ticket #480 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

Custom style setting fails to load on padre restart

Reported by: bricas Owned by:
Priority: major Milestone:
Component: Syntax Highlighting Version: 0.41
Keywords: Cc:

Description

If I use a custom style, then restart padre, I get the following error message:

Failed to load YAML document from '/usr/local/share/perl/5.10.0/auto/share/dist/Padre/styles/mine.yml' at /usr/local/share/perl/5.10.0/Padre/Wx/Editor.pm line 101

It appears that Padre thinks it was a shared style rather than one of my own.

Change History

comment:1 Changed 3 years ago by szabgab

  • Component changed from editor to Syntax Highlighting

Is this still happening in 0.84?

comment:2 Changed 3 years ago by bricas

Yes.

With Padre 0.84:

Failed to load YAML document from '/usr/local/share/perl/5.10.1/auto/share/dist/Padre/styles/mine.yml' at /usr/local/share/perl/5.10.1/Padre/Wx/Editor.pm line 198

comment:3 Changed 3 years ago by szabgab

The code at line 198 looks like this:

	eval { $tdata = YAML::Tiny::LoadFile($file); };
	if ($@) {
		warn $@;
	}

So I don't understand it.
Are you sure that file is a valid YAML file?

Besides the path in the error message points to the directory where the standard styles can be found. The personal styles should be in ~/.padre/styles/

comment:4 Changed 3 years ago by bricas

Steps to reproduce it:

  1. Copy an existing style to your local style dir as mine.yml. For me, this was: cp /usr/local/share/perl/5.10.1/auto/share/dist/Padre/styles/default.yml ~/.local/share/.padre/styles/mine.yml
  2. Start Padre
  3. Under View->Style select "mine"
  4. Close Padre
  5. Start Padre (from the command-prompt so you can see the warning)

comment:5 Changed 3 years ago by szabgab

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

With this description I managed to reproduced the bug and fixed it in r14146 in 0.85

Note: See TracTickets for help on using tickets.