Whenever a prompt string exceeds `jupyter-repl-prompt-margin-width`, increase
`jupyter-repl-prompt-margin-width` so that is can accommodate the string and
redisplay all prompts.
When inserting continuation prompts, extra text deletion entries where being
added in `buffer-undo-list` which caused yanked text to not be undone fully
since it would add in those entries before undoing the yank.
The "current input cell" is intended to be the last cell in the REPL buffer so
go to `point-max` before calling `jupyter-repl-cell-beginning-position`.
* Add `jupyter-repl-syntax-propertize-function`. This allows packages like
`rainbow-delimiters-mode` to work regardless of what is printed as output of
a REPL cell by setting the syntax-table property on parenthesis in REPL
output.
* Fix an issue with the Julia REPL which would cause `syntax-ppss` to
report the wrong parenthesis depth due to the `]` character of the REPL
package mode. Thus interfering with how `rainbow-delimiters-mode` works.
* Ensure that the kernel language's syntax table is used when fontifying and
adding syntax properties.
There is no need to reset the prompt when it isn't displaying the cell count.
This also ensures that a kernel that shows a prompt other than the input prompt
doesn't get overwritten.
This replaces the `jupyter-repl--handle-payload` function and allows payloads
to be handled in other contexts than the REPL, for example inserting a new
source block when receiving a set_next_input payload for the `org-mode` client.
Uses the new function `jupyter-repl-font-lock-fontify-region` to fontify a REPL
buffer. This function will only fontify regions corresponding to input cells
and excludes all other regions from fontification. Regions besides input cells
correspond mainly to output from the kernel and use font-lock-face to fontify
their contents.
This allows us to remove the functions and variables related to adding syntax
properties to the output of a cell since these were previously used to avoid
syntactic fontification of the output.
Adds `jupyter-repl--syntax-propertize` which generalizes the old
`syntax-propertize-function` to handle regions containing both cell code and
cell output.
In Emacs, the end position of a region is exclusive. So functions like
`delete-region` will delete the entire region specified excluding the end
position. Follow this convention with the cell code position.
This fixes issues when adding syntax properties to a cell's code. See
`jupyter-repl-initialize-fontification`.