This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Merged
Changes from 128 commits
Commits
Show all changes
136 commits
Select commit
Hold shift + click to select a range
84bb68d
Added: Initial tables support.
jodator 0295625
Tests: Add basic tests for downcast conversion.
jodator 65d47a2
Tests: Add manual tests for tables.
jodator 60deb59
Other: Rename tables to table.
jodator 036dfbc
Other: Update package.json dependencies.
jodator 305b933
Added: Initial `InsertTableCommand` implementation.
jodator 32e1756
Added: Initial 'insertTable' button.
jodator f55eb37
Changed: Bind 'insertTable' button to command.
jodator 421b171
Other: Update package.json dependencies.
jodator 7f3156e
Changed: Support heading rows as table attribute.
jodator 7026f11
Tests: Add basic converter tests.
jodator ab6c03c
Tests: Update table/converters tests.
jodator c91b59c
Tests: Add basic InsertTableCommand tests.
jodator 9fae5f5
Tests: Add basic TableUI tests for insertTableButton.
jodator 39d61cf
Changed: Create `upcastTable()` converter.
jodator ba0f7d7
Changed: Unify table converter methods invocation.
jodator e0eaa83
Changed: Add custom upcast converter for table.
jodator 5e087ce
Changed: Properly mark th in thead.
jodator a850114
Added: Support for heading cols in downcast conversion.
jodator 8af846e
Added: Basic table heading columns calculation.
jodator 917f9fb
Other: Added minor documentation.
jodator f0b9c0d
Changed: table/converters cleanup.
jodator 832bba3
Test: Change test for splitting not allowed parent.
jodator 781365b
Added: Heading columns calculation should consider `colspan` attribute.
jodator 343551c
Added: Consider `colspan` attribute in `headingColumns` support in do…
jodator 746d911
Added: Calculate heading column cells should consider rowspan and cel…
jodator ba19638
Changed: Refactor table converters and make CellSpans class private.
jodator 6c06846
Changed: Extract downcastTable() and upcastTable() converters to sepa…
jodator 7a1c197
Docs: Update `downcastTable()` documentation.
jodator 66710c1
Docs: Update `upcastTable()` documentation.
jodator 6accc44
Docs: Update Table & InsertTableCommand documentation.
jodator d5719d3
Align code to changes in heading command changes.
jodator 78befaa
Other: Basic insert row & insert column commands.
jodator 60a95c4
Other: Count cell spans when inserting rows & columns.
jodator dcbd0f8
Tests: Add temporary insertRow & insertColumn buttons tests.
jodator 5650eb0
Other: Initial 'insert:tableRow' downcast converter implementation.
jodator ab4c55e
Added: Make inserted rows appear in proper table section in the view.
jodator aad39c9
Added: Add insert table column downcast converter.
jodator 6d69b88
Added: Initial support for converting table attributes changes.
jodator 91ab2c7
Other: Reorder methods in table/converters/downcasttable and add some…
jodator 5834174
Added: Make insert row command aware of previous rowspans.
jodator 0381c19
Tests: Add simple cell merge & split simulation tests in downcast con…
jodator 4648335
Fix: Change table attribute should only check existing view elements …
jodator 52c85db
Tests: Remove wrong downcast definition.
jodator 6176753
Changed: Extract CellSpans to own file as it is used by commands and …
jodator d2b50d6
Added: Introduce TableIterator.
jodator 79e6ef8
Changed: Refactor TableIterator#iterateOverRow() to TableIterator#ite…
jodator dfaab8f
Docs: Update TableIterator docs.
jodator e38cf0d
Changed: TableIterator should yield table properties also.
jodator ce4f50a
Changed: Refactor TableIterator to a TableWalker.
jodator fc9b50b
Docs: Update TableWalker documentation.
jodator 3834b06
Changed: Cache table attributes in TableWalker.
jodator 523cca2
Docs: Update the docs of a TableWalker.
jodator 3652776
Other: Refactor downcasttable.
jodator 62e4222
Docs: Review `upcastTable()` docs.
jodator 026f0c7
Other: Update dependencies.
jodator 783b07f
Other: Refactor exports fo downcast converters helper module.
jodator b5d146a
Other: Extract common utils from commands and move commands to own mo…
jodator 22c80a4
Added: Custom remove table row downcast converter.
jodator 98fd8d5
Fix: Change where the table cell is consumed in downcast converters.
jodator 39b11db
Update dependencies.
jodator 31dc1c2
Other: Enable table widget in editing view.
jodator a8f067c
Added: Initial Tab key support.
jodator 1585569
Tests: Fix imports in tests.
jodator a65b4a0
Added: Handle Shift+Tab keystroke handling in table.
jodator 1099d6a
Changed: Make tab movement in table select whole cell.
jodator 2e99f2a
Tests: Add test for `asWidget` option of `downcastInsertTable()`.
jodator fe5d290
Other: Add Widget to Table feature requires.
jodator 3b9d0eb
Added: Use Tab to entry table if whole widget is selected.
jodator 62e1123
Other: Update TableEditing docs & improve code readability.
jodator 79e9c6e
Changed: Make table cell elements render as nested editables in editi…
jodator db9e7e0
Added: Add includeSpanned option to TableWalker.
jodator 34b6cbc
Added: Add split cell command.
jodator 84a82a2
Added: RemoveRow command.
jodator 1ef4b72
Other: Fix docs & imports.
jodator 63e96b3
Tests: Rename formatModelTable() tests helper to formatTable().
jodator f6cd1d9
Other: Update dependencies.
jodator 886e203
Added: Initial RemoveColumnCommand implementation.
jodator d259e99
Added: Initial mergeRight and mergeLeft commands implementation.
jodator 2cc7f16
Changed: MergeCellCommand value should be set to a mergable tableCell.
jodator 7891c59
Added: Initial mergeDown command implementation.
jodator e5a72a4
Added: Initial mergeUp command implementation.
jodator 4780c20
Added: The `downcastAttributeChange()` conversion helper should accep…
jodator 1d1a824
Added: Initial SetTableHeadersCommand implementation.
jodator 17093e9
Fixed: SetTableHeadersCommand should split rowspanned cells that over…
jodator f431ff9
Changed: SplitCell command should split cell horizontally to given nu…
jodator 6460741
Tests: Add tests for command/utils.
jodator 5fa2b4a
Changed: Remove unsplitVertically() method from commands/utils.
jodator 470b741
Changed: Refactor TableWalker.
jodator e2fd0b1
Changed: Refactor InsertRowCommand to TableUtils plugin and introduce…
jodator 0cee23d
Tests: Fix TableUI tests.
jodator 9866ab8
Fix: The set table headers command should properly split rowspanned c…
jodator 57de23d
Changed: Extract cell splitting to TableUtils plugin.
jodator 8da3296
Added: Initial `TableUtils#splitCellVertically` implementation.
jodator 15bf753
Other: Update dependencies.
jodator 9d772fe
Added: Support of rowspaned cells update in `TableUtils#splitCellHori…
jodator e405216
Changed: Create `TableUtils#insertColumns()` and create 'insertColumn…
jodator 1584a06
Refactor the `TableUtils#insertColumns()` method.
jodator b5af141
Refactor InsertColumnCommand and create the `TableUtils#getCellLocati…
jodator 2c31735
Refactor InsertRowCommand.
jodator ff13aa8
Refactor InsertTableCommand and create the `TableUtils#createTable()`…
jodator 4fa50de
Refactor MergeCellCommand.
jodator 3e2255b
Tests: Update manual tests UI components.
jodator b4a9bac
Refactor RemoveColumnCommand & move getColumns() to TableUtils plugin.
jodator 832d9c3
Other: Refactor commands.
jodator c033c6a
Other: Refactor TableUtils class and update docs.
jodator 723f8e0
Fix: The multiple rowspanned cells prevents proper column insertion.
jodator f557f70
Other: Review table commands names & add tests for TableEditing.
jodator 5e1df9f
Fixed: Splitting table cell with rowspan should reduce this attribute…
jodator 4372c1f
Fixed: Properly handle splitting cells depending of cell's rowspan at…
jodator 7d0a897
Fixed: Properly handle splitting cells vertically that have colspan.
jodator 98dc70a
Fix: Cannot insert row at index 0 if table has heading rows attribute…
jodator 3904209
Align code to the latest changes in converters API.
jodator fa3c941
Fix: Splitting table cell vertically in heading section should update…
jodator 1b84de8
Fix: Merge cell command should be disabled for directions that cross …
jodator 4dc4c7e
Minor typos in docs and code style.
scofalik 9dc22d4
Fixed: The split cell vertically and horizontally was wrongly used in…
jodator ca82cec
Other: Improve readability of downcast attribute converters.
jodator 7ab358e
Docs: Update TableUtils#insertRows() and TableUtils#insertColumns() m…
jodator dde5b21
Docs: Further enhance TableUtils docs.
jodator 2ec4dcf
Changed: Cleanup downcast conversion & update TableWalker internals.
jodator 0169ba8
Docs: Update TableUtils.splitCell* methods docs.
jodator bec3efa
Fix: Fix TableUtils#splitCellVertically() algorithm and update docs.
jodator 4b42130
Other: Remove custom upcast converter for tableRow.
jodator 0e2f65e
Other: Make isHorizontal property of MergeCellCommand.
jodator c415ace
Other: Cleanup code.
jodator 8e38949
Docs: Fixed @returns use. [skip ci]
Reinmar a3fb896
Fixed class names.
Reinmar 229d70f
Minor API docs fixes.
Reinmar a47aea1
Changed: Remove redundant options from from table schema.
jodator ec3aacb
Docs: Fix TableUtils#splitCellVertically() description.
jodator 880b911
Changed: Iterate over a row only of inserted table cell in downcast c…
jodator 9411b3f
Changed: Remove redundant parseInt() for table attributes.
jodator f41171f
Changed some comments, docs and code order.
scofalik be183f4
Fixed wrong variable name.
scofalik f6bbbab
Changed: Make upcasting empty table more explicit.
jodator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/** | ||
* @module table/commands/insertcolumncommand | ||
*/ | ||
|
||
import Command from '@ckeditor/ckeditor5-core/src/command'; | ||
import { getParentTable } from './utils'; | ||
import TableUtils from '../tableutils'; | ||
|
||
/** | ||
* The insert column command. | ||
* | ||
* @extends module:core/command~Command | ||
*/ | ||
export default class InsertColumnCommand extends Command { | ||
/** | ||
* Creates a new `InsertRowCommand` instance. | ||
* | ||
* @param {module:core/editor/editor~Editor} editor Editor on which this command will be used. | ||
* @param {Object} options | ||
* @param {String} [options.order="after"] The order of insertion relative to a column in which caret is located. | ||
* Possible values: "after" and "before". | ||
*/ | ||
constructor( editor, options = {} ) { | ||
super( editor ); | ||
|
||
/** | ||
* The order of insertion relative to a column in which caret is located. | ||
* | ||
* @readonly | ||
* @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order | ||
*/ | ||
this.order = options.order || 'after'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
refresh() { | ||
const selection = this.editor.model.document.selection; | ||
|
||
const tableParent = getParentTable( selection.getFirstPosition() ); | ||
|
||
this.isEnabled = !!tableParent; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
execute() { | ||
const editor = this.editor; | ||
const selection = editor.model.document.selection; | ||
const tableUtils = editor.plugins.get( TableUtils ); | ||
|
||
const table = getParentTable( selection.getFirstPosition() ); | ||
const tableCell = selection.getFirstPosition().parent; | ||
|
||
const { column } = tableUtils.getCellLocation( tableCell ); | ||
const insertAt = this.order === 'after' ? column + 1 : column; | ||
|
||
tableUtils.insertColumns( table, { columns: 1, at: insertAt } ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/** | ||
* @module table/commands/insertrowcommand | ||
*/ | ||
|
||
import Command from '@ckeditor/ckeditor5-core/src/command'; | ||
import { getParentTable } from './utils'; | ||
import TableUtils from '../tableutils'; | ||
|
||
/** | ||
* The insert row command. | ||
* | ||
* @extends module:core/command~Command | ||
*/ | ||
export default class InsertRowCommand extends Command { | ||
/** | ||
* Creates a new `InsertRowCommand` instance. | ||
* | ||
* @param {module:core/editor/editor~Editor} editor Editor on which this command will be used. | ||
* @param {Object} options | ||
* @param {String} [options.order="below"] The order of insertion relative to a row in which caret is located. | ||
* Possible values: "above" and "below". | ||
*/ | ||
constructor( editor, options = {} ) { | ||
super( editor ); | ||
|
||
/** | ||
* The order of insertion relative to a row in which caret is located. | ||
* | ||
* @readonly | ||
* @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order | ||
*/ | ||
this.order = options.order || 'below'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
refresh() { | ||
const selection = this.editor.model.document.selection; | ||
|
||
const tableParent = getParentTable( selection.getFirstPosition() ); | ||
|
||
this.isEnabled = !!tableParent; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
execute() { | ||
const editor = this.editor; | ||
const selection = editor.model.document.selection; | ||
const tableUtils = editor.plugins.get( TableUtils ); | ||
|
||
const tableCell = selection.getFirstPosition().parent; | ||
const table = getParentTable( selection.getFirstPosition() ); | ||
|
||
const row = table.getChildIndex( tableCell.parent ); | ||
const insertAt = this.order === 'below' ? row + 1 : row; | ||
|
||
tableUtils.insertRows( table, { rows: 1, at: insertAt } ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/** | ||
* @module table/commands/inserttablecommand | ||
*/ | ||
|
||
import Command from '@ckeditor/ckeditor5-core/src/command'; | ||
import Position from '@ckeditor/ckeditor5-engine/src/model/position'; | ||
import TableUtils from '../tableutils'; | ||
|
||
/** | ||
* The insert table command. | ||
* | ||
* @extends module:core/command~Command | ||
*/ | ||
export default class InsertTableCommand extends Command { | ||
/** | ||
* @inheritDoc | ||
*/ | ||
refresh() { | ||
const model = this.editor.model; | ||
const selection = model.document.selection; | ||
const schema = model.schema; | ||
|
||
const validParent = getInsertTableParent( selection.getFirstPosition() ); | ||
|
||
this.isEnabled = schema.checkChild( validParent, 'table' ); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
execute( options = {} ) { | ||
const model = this.editor.model; | ||
const selection = model.document.selection; | ||
const tableUtils = this.editor.plugins.get( TableUtils ); | ||
|
||
const rows = parseInt( options.rows ) || 2; | ||
const columns = parseInt( options.columns ) || 2; | ||
|
||
const firstPosition = selection.getFirstPosition(); | ||
|
||
const isRoot = firstPosition.parent === firstPosition.root; | ||
const insertPosition = isRoot ? Position.createAt( firstPosition ) : Position.createAfter( firstPosition.parent ); | ||
|
||
tableUtils.createTable( insertPosition, rows, columns ); | ||
} | ||
} | ||
|
||
// Returns valid parent to insert table | ||
// | ||
// @param {module:engine/model/position} position | ||
function getInsertTableParent( position ) { | ||
const parent = position.parent; | ||
|
||
return parent === parent.root ? parent : parent.parent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/** | ||
* @module table/commands/mergecellcommand | ||
*/ | ||
|
||
import Command from '@ckeditor/ckeditor5-core/src/command'; | ||
import Position from '@ckeditor/ckeditor5-engine/src/model/position'; | ||
import Range from '@ckeditor/ckeditor5-engine/src/model/range'; | ||
import TableWalker from '../tablewalker'; | ||
|
||
/** | ||
* The merge cell command. | ||
* | ||
* @extends module:core/command~Command | ||
*/ | ||
export default class MergeCellCommand extends Command { | ||
/** | ||
* Creates a new `MergeCellCommand` instance. | ||
* | ||
* @param {module:core/editor/editor~Editor} editor Editor on which this command will be used. | ||
* @param {Object} options | ||
* @param {String} options.direction Indicates which cell merge to currently selected one. | ||
* Possible values are: "left", "right", "up" and "down". | ||
*/ | ||
constructor( editor, options ) { | ||
super( editor ); | ||
|
||
/** | ||
* The direction indicates which cell will be merged to currently selected one. | ||
* | ||
* @readonly | ||
* @member {String} module:table/commands/mergecellcommand~MergeCellCommand#direction | ||
*/ | ||
this.direction = options.direction; | ||
|
||
/** | ||
* Whether the merge is horizontal (left/right) or vertical (up/down). | ||
* | ||
* @readonly | ||
* @member {Boolean} module:table/commands/mergecellcommand~MergeCellCommand#isHorizontal | ||
*/ | ||
this.isHorizontal = this.direction == 'right' || this.direction == 'left'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
refresh() { | ||
const cellToMerge = this._getMergeableCell(); | ||
|
||
this.isEnabled = !!cellToMerge; | ||
// In order to check if currently selected cell can be merged with one defined by #direction some computation are done beforehand. | ||
// As such we can cache it as a command's value. | ||
this.value = cellToMerge; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
execute() { | ||
const model = this.editor.model; | ||
const doc = model.document; | ||
const tableCell = doc.selection.getFirstPosition().parent; | ||
const cellToMerge = this.value; | ||
const direction = this.direction; | ||
|
||
model.change( writer => { | ||
const isMergeNext = direction == 'right' || direction == 'down'; | ||
|
||
// The merge mechanism is always the same so sort cells to be merged. | ||
const cellToExpand = isMergeNext ? tableCell : cellToMerge; | ||
const cellToRemove = isMergeNext ? cellToMerge : tableCell; | ||
|
||
writer.move( Range.createIn( cellToRemove ), Position.createAt( cellToExpand, 'end' ) ); | ||
writer.remove( cellToRemove ); | ||
|
||
const spanAttribute = this.isHorizontal ? 'colspan' : 'rowspan'; | ||
const cellSpan = parseInt( tableCell.getAttribute( spanAttribute ) || 1 ); | ||
const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 ); | ||
|
||
writer.setAttribute( spanAttribute, cellSpan + cellToMergeSpan, cellToExpand ); | ||
|
||
writer.setSelection( Range.createIn( cellToExpand ) ); | ||
} ); | ||
} | ||
|
||
/** | ||
* Returns a cell that is mergeable with current cell depending on command's direction. | ||
* | ||
* @returns {module:engine/model/element|undefined} | ||
* @private | ||
*/ | ||
_getMergeableCell() { | ||
const model = this.editor.model; | ||
const doc = model.document; | ||
const element = doc.selection.getFirstPosition().parent; | ||
|
||
if ( !element.is( 'tableCell' ) ) { | ||
return; | ||
} | ||
|
||
// First get the cell on proper direction. | ||
const cellToMerge = this.isHorizontal ? getHorizontalCell( element, this.direction ) : getVerticalCell( element, this.direction ); | ||
|
||
if ( !cellToMerge ) { | ||
return; | ||
} | ||
|
||
// If found check if the span perpendicular to merge direction is equal on both cells. | ||
const spanAttribute = this.isHorizontal ? 'rowspan' : 'colspan'; | ||
const span = parseInt( element.getAttribute( spanAttribute ) || 1 ); | ||
|
||
const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 ); | ||
|
||
if ( cellToMergeSpan === span ) { | ||
return cellToMerge; | ||
} | ||
} | ||
} | ||
|
||
// Returns horizontally mergeable cell. | ||
// | ||
// @param {module:engine/model/element~Element} tableCell | ||
// @param {String} direction | ||
// @returns {module:engine/model/node~Node|null} | ||
function getHorizontalCell( tableCell, direction ) { | ||
return direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling; | ||
} | ||
|
||
// Returns vertically mergeable cell. | ||
// | ||
// @param {module:engine/model/element~Element} tableCell | ||
// @param {String} direction | ||
// @returns {module:engine/model/node~Node|null} | ||
function getVerticalCell( tableCell, direction ) { | ||
const tableRow = tableCell.parent; | ||
const table = tableRow.parent; | ||
|
||
const rowIndex = table.getChildIndex( tableRow ); | ||
|
||
// Don't search for mergeable cell if direction points out of the table. | ||
if ( ( direction == 'down' && rowIndex === table.childCount - 1 ) || ( direction == 'up' && rowIndex === 0 ) ) { | ||
return; | ||
} | ||
|
||
const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 ); | ||
|
||
// Don't search for mergeable cell if direction points out of the current table section. | ||
if ( headingRows && ( ( direction == 'down' && rowIndex === headingRows - 1 ) || ( direction == 'up' && rowIndex === headingRows ) ) ) { | ||
return; | ||
} | ||
|
||
const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 ); | ||
const mergeRow = direction == 'down' ? rowIndex + rowspan : rowIndex; | ||
|
||
const tableMap = [ ...new TableWalker( table, { endRow: mergeRow } ) ]; | ||
|
||
const currentCellData = tableMap.find( value => value.cell === tableCell ); | ||
const mergeColumn = currentCellData.column; | ||
|
||
const cellToMergeData = tableMap.find( ( { row, column } ) => { | ||
return column === mergeColumn && ( direction == 'down' ? mergeRow === row : mergeRow === rowspan + row ); | ||
} ); | ||
|
||
return cellToMergeData && cellToMergeData.cell; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right. Or rather looks too simple. Is it copied from somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the second one: too simple. I'll check how this can be improved.