More looping updates
This commit is contained in:
parent
2871ead27d
commit
be415d28b8
@ -186,6 +186,12 @@ class Editor {
|
|||||||
|
|
||||||
$row = Row::new($this, $s, $at);
|
$row = Row::new($this, $s, $at);
|
||||||
|
|
||||||
|
// Update row indicies
|
||||||
|
for ($i = $at + 1; $i < $this->numRows; $i++)
|
||||||
|
{
|
||||||
|
$this->rows[$i]->idx++;
|
||||||
|
}
|
||||||
|
|
||||||
if ($at === $this->numRows)
|
if ($at === $this->numRows)
|
||||||
{
|
{
|
||||||
$this->rows[] = $row;
|
$this->rows[] = $row;
|
||||||
@ -197,12 +203,6 @@ class Editor {
|
|||||||
$row,
|
$row,
|
||||||
...array_slice($this->rows, $at),
|
...array_slice($this->rows, $at),
|
||||||
];
|
];
|
||||||
|
|
||||||
// Update row indicies
|
|
||||||
foreach ($this->rows as $i => $row)
|
|
||||||
{
|
|
||||||
$row->idx = $i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->rows[$at]->update();
|
$this->rows[$at]->update();
|
||||||
|
@ -429,11 +429,12 @@ class Row {
|
|||||||
|
|
||||||
protected function updateSyntaxPHP():void
|
protected function updateSyntaxPHP():void
|
||||||
{
|
{
|
||||||
// The index for the tokens should exist
|
if ( ! isset($this->parent->syntax->tokens))
|
||||||
if ( ! array_key_exists($this->idx + 1, $this->parent->syntax->tokens))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The index for the tokens should exist
|
||||||
$tokens = $this->parent->syntax->tokens[$this->idx + 1];
|
$tokens = $this->parent->syntax->tokens[$this->idx + 1];
|
||||||
|
|
||||||
// $inComment = ($this->idx > 0 && $this->parent->rows[$this->idx - 1]->hlOpenComment);
|
// $inComment = ($this->idx > 0 && $this->parent->rows[$this->idx - 1]->hlOpenComment);
|
||||||
|
Loading…
Reference in New Issue
Block a user