You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e2c13aa
Browse filesBrowse the repository at this point in the historyBrowse files
`About to update DataStore.settings to newSettings after an update. If you see a TypeError right after this, please ignore it. It's a known NP bug that doesn't seem to matter.`,
101
125
)
102
126
DataStore.settings=newSettings
103
127
}
104
128
}catch(error){
105
-
console.log(
106
-
'NPConfiguration/updateSettingData/Plugin Settings Migration Failed. Was not able to automatically migrate your plugin settings to the new version. Please open the plugin settingsand save in order to update your settings.',
129
+
logError('updateSettingData',
130
+
'Plugin Settings Migration Failed. Was not able to automatically migrate your plugin settings to the new version. Please open the plugin settings, check them, and then save in order to update your settings.',
107
131
)
108
132
updateResult=-1
109
133
}
@@ -568,6 +592,7 @@ export async function getSettingFromAnotherPlugin(pluginID: string, settingName:
568
592
569
593
/**
570
594
* Backup the settings.json file for 'pluginID' to a dated version in the plugin data folder.
595
+
* Note: this fails if the file is not valid JSON, unfortunately. @jgclark can't find a way around this.
Copy file name to clipboardExpand all lines: helpers/NPEditor.js
+56Lines changed: 56 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -239,6 +239,62 @@ export function isNoteOpenInEditor(filename: string): boolean {
239
239
returnfalse
240
240
}
241
241
242
+
/**
243
+
* Returns the first open Editor window that matches a given filename (if any).
244
+
* If 'getLastOpenEditor' is true, then return the last matching open Editor window (which is the most recently opened one) instead.
245
+
* TEST: Changes 30.3.2026
246
+
* @author@jgclark
247
+
* @param {string} openNoteFilename to find in list of open Editor windows
248
+
* @param {boolean} getLastOpenEditor - whether to return the last open Editor window (which is the most recently opened one) instead of the first one that matches the filename (the default)
249
+
* @returns {TEditor | false} the matching open Editor window or false if not found
logDebug('getFirstRegularNoteAmongOpenEditors',`Using open editor pane for '${candidate.filename||candidate.title||'?'}' (focused pane was not a regular note)`)
287
+
returncandidate
288
+
}
289
+
}
290
+
logDebug('getFirstRegularNoteAmongOpenEditors',`No open Editor pane contains a regular (Notes) note`)
0 commit comments