Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion csvEditorHtml/browser/beforeDomLoadedBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ var initialConfig: EditCsvConfig | undefined = {
initialNumbersStyle: 'en',
insertRowBehavior: 'keepRowKeepColumn',
insertColBehavior: 'keepRowKeepColumn',
initiallyIsInReadonlyMode: false,
hideOpenCsvEditorUiActions: false, //noop, has only effect if set inside the user settings (vs code extension)
openTableAndSelectCellAtCursorPos: "never",
pasteMode: 'normal',
Expand Down
2 changes: 1 addition & 1 deletion csvEditorHtml/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ function handleVsCodeMessage(event: { data: ReceivedMessageFromVsCode }) {
}

default: {
_error('received unknown message from vs code')
console.warn(`received unknown message from vs code: ${JSON.stringify(message)}`)
notExhaustiveSwitch(message)
break
}
Expand Down
2 changes: 1 addition & 1 deletion csvEditorHtml/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ let shouldApplyHasHeaderAfterRowsAdded = false
* table is editable or not, also disables some related ui, e.g. buttons
* set via {@link EditCsvConfig.initiallyIsInReadonlyMode}
*/
let isReadonlyMode = false
let isReadonlyMode = true

/**
* the original csv file has a layout and sometimes we use the original positions
Expand Down
8 changes: 0 additions & 8 deletions csvEditorHtml/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,6 @@ type EditCsvConfig = {
*/
insertColBehavior: 'keepRowFocusNewColumn' | 'keepRowKeepColumn'

/**
* table should start in readonly mode?
* true: table is view only,
* false: edit mode (normal)
* NOTE that initial fixes (e.g. all rows should have the same length) are applied because readonly is only applied after/during the table is created
*/
initiallyIsInReadonlyMode: boolean

/**
* false: hide the edit csv button and the file context menu action to open the editor (useful if you want to call this extension from another extension and show a custom button),
* true: show them
Expand Down
9 changes: 9 additions & 0 deletions csvEditorHtml/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2149,6 +2149,15 @@ function displayData(this: any, csvParseResult: ExtendedCsvParseResult | null, c
* then we set the editor to has changes
*/
function onAnyChange(changes?: CellChanges[] | null, reason?: string) {
/**
* Previously, an asterisk (*) was shown indicating unsaved changes
* even when no actual modifications were made.
* This fix ignores cases where the reason is undefined
* and no real changes have occurred.
*/
if (!reason && (!changes || changes.length === 0)) {
return;
}

//this is the case on init (because initial data set)
//also when we reset data (button)
Expand Down
1 change: 0 additions & 1 deletion csvEditorHtml/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,6 @@ function setupAndApplyInitialConfigPart1(initialConfig: EditCsvConfig | undefine
fixedRowsTopInfoSpan.innerText = fixedRowsTop + ''
fixedColumnsTopInfoSpan.innerText = fixedColumnsLeft + ''

isReadonlyMode = initialConfig.initiallyIsInReadonlyMode
_updateToggleReadonlyModeUi()

setNumbersStyleUi(initialConfig.initialNumbersStyle)
Expand Down
1 change: 0 additions & 1 deletion out/configurationHelper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions out/csvAutoOpenProvider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading