yhirose / cpp-peglib

A single file C++ header-only PEG (Parsing Expression Grammars) library
MIT License
883 stars 112 forks source link

Online playground on error click add scroolToLine #198

Closed mingodad closed 2 years ago

mingodad commented 2 years ago

On the online playground when we click an error message if we add scroolToLine then the editor does exactly that:

index.js:

...
// Event handing in the info area
function makeOnClickInInfo(editor) {
  return function () {
    const el = $(this);
    editor.navigateTo(el.data('ln') - 1, el.data('col') - 1);
    editor.scrollToLine(el.data('ln') - 1, true, false, null);  /////!!!!! <<<<<  add it here
    editor.focus();
  }
};
...
mingodad commented 2 years ago

Also adding a hover background color on error messages make then more evident: style.css:

...
.editor-info li:hover{
  background-color: yellow;
}
yhirose commented 2 years ago

@mingodad, could you send a pull request which is much easier for me to review? Thanks for your understanding.

yhirose commented 2 years ago

Fixed at #199.