0

In the SQL Syntax Highligter Example an example of formatters API is shown. However, it appears that the string that is passed to a custom formatter function is not whole user input string, but parts of it before and after the cursor (the function is called multiple times with different parts of input string).

This weird behavior leads to some highlighting artefacts, such as: highlighting disappears when user moves the cursor over keyword. Is there a way to apply formatter to the whole input string instead?

ovk
  • 2,318
  • 1
  • 23
  • 30
  • 1
    Unfortunately no, with current code it will always disappear when you move the cursor over formatting, but I can try to make it show formatting when cursor is over formatting. – jcubic Jul 31 '17 at 06:44
  • @jcubic that would be awesome.I think there should be another type of formatter, which only calls user defined function when user input is changed, and passes the whole input string for formatting as a parameter. – ovk Jul 31 '17 at 15:11
  • 1
    in devel branch it now use formatting first and then use `$.terminal.substring` to get before/cursor/after so now formatting don't change, it will be in version 1.5.2 – jcubic Jul 31 '17 at 15:20

0 Answers0