QOwnNotes icon indicating copy to clipboard operation
QOwnNotes copied to clipboard

[I] Bracket incorrectly removed/ paired when incompletely nested

Open major-mayer opened this issue 1 year ago • 5 comments

Expected behaviour

If you remove a close bracket ")" that has not matching open bracket, nothing else should be removed. Ofc, this behavior should hold for all other types of brackets as well.

Actual behaviour

When I put a text in round and then continue with another text in squared bracket and within those squared brackets add an "incomplete" close round bracket, which i try to remove, it removes the something from the previous round brackets as well.

Steps to reproduce

Write the following in the editor:

Test (abc) [def)] 

Now, try to remove the close bracket after the "f" and before the "]". Observe how it removes the open bracket of the first pair of brackets.

Relevant log output in the Log panel

Expand
[13:43:51] [warning] Wayland does not support QWindow::requestActivate()
[13:43:57] [status] Eine Notiz auf Datenträger gespeichert

Information about the application, settings and environment

Expand

QOwnNotes Debug Information

General Info

Current Date: Di. Aug. 27 13:44:02 2024 Version: 24.8.6 Build date: Aug 23 2024 Build number: 1121 Platform: linux (wayland) Operating System: Manjaro Linux Build architecture: x86_64 Current architecture: x86_64 Release: AUR Qt Version (build): 5.15.14 Qt Version (runtime): 5.15.14 Portable mode: no Settings path / key: /home/laurenz/.config/PBE/QOwnNotes.conf Application database path: /home/laurenz/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite Application arguments: /usr/bin/QOwnNotes Qt Debug: 0 Locale (system): de_DE Locale (interface): empty Primary screen resolution: 2743x1543 Screen resolution(s): 2743x1543, 1920x1080, 1920x1080 Icon theme: breeze Notes in current note folder: 6 Calendar items: 0 Enabled scripts: 0 Database drivers: QIBASE, QSQLITE, QMARIADB, QMYSQL, QMYSQL3, QODBC, QODBC3, QPSQL, QPSQL7, QTDS, QTDS7

Server Info

serverUrl: empty appIsValid: no notesPathExists: empty connectionErrorMessage: empty

Spellchecking

Enabled: true Selected language: auto Language codes: de_AT, de_BE, de_CH, de_DE, de_LI, de_LU, en_AG, en_BS, en_BW, en_BZ, en_DK, en_GB, en_GB-large, en_GH, en_HK, en_IE, en_IN, en_JM, en_NA, en_NG, en_NZ, en_SG, en_TT, en_ZA, en_ZW Language names: Österreichisches Deutsch (Österreich), Deutsch (Belgien), Schweizer Hochdeutsch (Schweiz), Deutsch (Deutschland), Deutsch (Liechtenstein), Deutsch (Luxemburg), English (Antigua & Barbuda), English (Bahamas), English (Botswana), English (Belize), English (Denmark), British English (United Kingdom), British English (United Kingdom) [groß], English (Ghana), English (Hong Kong SAR China), English (Ireland), English (India), English (Jamaica), English (Namibia), English (Nigeria), English (New Zealand), English (Singapore), English (Trinidad & Tobago), English (South Africa), English (Zimbabwe) Application dictionaries path: /home/laurenz/.local/share/PBE/QOwnNotes/dicts

Note folders

currentNoteFolderId: 2

Note folder Standard

id: 1 isCurrent: no activeTagId: 0 localPath: /home/laurenz/Nextcloud/Notes remotePath: Notes cloudConnectionId: 1 isShowSubfolders: no isUseGit: no allowDifferentNoteFileName: no activeNoteSubFolder name: empty database file: /home/laurenz/Nextcloud/Notes/notes.sqlite

Note folder Sciebo

id: 2 isCurrent: yes activeTagId: 0 localPath: /home/laurenz/Sciebo/Notes remotePath: Notes cloudConnectionId: 1 isShowSubfolders: no isUseGit: no allowDifferentNoteFileName: no activeNoteSubFolder name: empty database file: /home/laurenz/Sciebo/Notes/notes.sqlite

Cloud connections

Cloud connection Standard

id: 1 isCurrent: yes serverUrl: empty username: empty accountId: empty

Enabled scripts

Settings

AboutDialog/geometry (QByteArray): <binary data> ActiveNoteHistoryItem (NoteHistoryItem): <binary data> Debug/fakeOldVersionNumber (QString): false Debug/fileLogging (QString): false Editor/CurrentSchemaKey (QString): EditorColorSchema-6033d61b-cb96-46d5-a3a8-20d5172017eb Editor/autoBracketClosing (QString): true Editor/autoBracketRemoval (QString): true Editor/disableCursorBlinking (QString): false Editor/editorWidthInDFMOnly (QString): true Editor/highlightCurrentLine (QString): true Editor/indentSize (QString): 4 Editor/removeTrailingSpaces (QString): false Editor/showLineNumbers (QString): false Editor/useTabIndent (QString): false Editor/vimMode (QString): false IssueAssistantDialog/geometry (QByteArray): <binary data> LastUpdateCheck (QDateTime): 2024-08-27T13:26:07.028 LogWidget/criticalLog (bool): true LogWidget/debugLog (bool): true LogWidget/fatalLog (bool): true LogWidget/infoLog (bool): true LogWidget/scriptingLog (bool): true LogWidget/statusLog (bool): true LogWidget/warningLog (bool): true MainWindow/geometry (QByteArray): <binary data> MainWindow/mainToolBar.iconSize (QString): 22 MainWindow/menuBarGeometry (QByteArray): <binary data> MainWindow/noteTextEdit.code.font (QString): Hack,10,-1,7,50,0,0,0,0,0 MainWindow/noteTextEdit.font (QString): Noto Sans,10,-1,0,50,0,0,0,0,0 MainWindow/noteTextView.code.font (QString): Hack,10,-1,7,50,0,0,0,0,0 MainWindow/noteTextView.font (QString): Noto Sans,10,-1,0,50,0,0,0,0,0 MainWindow/noteTextView.ignoreCodeFontSize (QString): true MainWindow/noteTextView.refreshDebounceTime (QString): 600 MainWindow/noteTextView.rtl (QString): false MainWindow/noteTextView.underline (QString): true MainWindow/noteTextView.useEditorStyles (QString): true MainWindow/noteTextView.useInternalExportStyling (QString): true NoteFolder-2/NoteTabNameList (QString): Themenfindung Masterarbeit NoteFolder-2/NoteTabStickinessList: empty NoteFolder-2/NoteTabSubFolderPathDataList (QString): empty NoteHistory-2 (QVariantList): <variant list with 3 item(s)> NoteHistoryCurrentIndex-2 (QString): 2 PiwikClientId (QString): <hidden> SearchEngineId (QString): 2 SettingsDialog/geometry (QByteArray): <binary data> SettingsDialog/mainSplitterState (QByteArray): <binary data> ShowSystemTray (QString): false StartHidden (QString): false WelcomeDialog/geometry (QByteArray): <binary data> acceptAllExternalModifications (QString): false ai/currentBackend (QString): openai ai/enabled (QString): false ai/groq/apiKey (QString): <hidden> ai/openai/apiKey (QString): <hidden> allowNoteEditing (bool): true allowOnlyOneAppInstance (QString): true appMetrics/disableAppHeartbeat (QString): false appMetrics/disableTracking (QString): false appMetrics/notificationShown (QString): true autoReadOnlyMode (QString): false autoReadOnlyModeTimeout (QString): 30 automaticNoteFolderDatabaseClosing (QString): false checkSpelling (bool): true closeTodoListAfterSave (QString): false cryptoKey (QString): <hidden> currentNoteFolderId (QString): 2 currentWorkspace (QString): initial cursorWidth (QString): 1 darkMode (QString): false darkModeColors (QString): false darkModeIconTheme (QString): false darkModeTrayIcon (QString): false defaultNoteFileExtension (QString): md demoNotesCreated (QString): true disableAutomaticUpdateDialog (QString): true disableSavedSearchesAutoCompletion (QString): false dockWasInitializedOnce (QString): true enableNoteTree (QString): false enableSocketServer (QString): true enableWebAppSupport (QString): false externalEditorPath (QString): empty fullyHighlightedBlockquotes (QString): false gitCommitInterval (QString): 30 gitExecutablePath (QString): empty gitLogCommand (QString): empty guiFirstRunInit (bool): true ignoreAllExternalModifications (QString): false ignoreAllExternalNoteFolderChanges (QString): false ignoreNoteSubFolders (QString): ^\. ignoredNoteFiles (QString): empty imageScaleDown (QString): false imageScaleDownMaximumHeight (QString): 1024 imageScaleDownMaximumWidth (QString): 1024 initialLayoutIdentifier (QString): minimal insertTimeFormat (QString): empty interfaceFontSize (QString): 11 interfaceLanguage (QString): empty internalIconTheme (QString): false itemHeight (QString): 24 legacyLinking (QString): false localTrash/autoCleanupDays (QString): 30 localTrash/autoCleanupEnabled (QString): true localTrash/supportEnabled (QString): true markdownHighlightingEnabled (QString): true navigationPanelAutoSelect (QString): true navigationPanelHideSearch (QString): false networking/ignoreSSLErrors (QString): true networking/proxyType (QString): 2 newNoteAskHeadline (QString): false noteEditIsCentralWidget (QString): true noteFileExtensionList (QStringList): md, txt noteListPreview (QString): false noteSaveIntervalTime (QString): 10 noteSubfoldersPanelDisplayAsFullTree (QString): true noteSubfoldersPanelHideSearch (QString): false noteSubfoldersPanelOrder (QString): 0 noteSubfoldersPanelShowFullPath (QString): false noteSubfoldersPanelShowNotesRecursively (QString): false noteSubfoldersPanelShowRootFolderName (QString): true noteSubfoldersPanelSort (QString): 0 noteSubfoldersPanelTabsUnsetAllNotesSelection (QString): false notesPanelOrder (QString): 0 notesPanelSort (QString): 1 notesPath (QString): /home/laurenz/Sciebo/Notes notifyAllExternalModifications (QString): false overrideInterfaceFontSize (QString): false ownCloud/supportEnabled (QString): false ownCloud/todoCalendarBackend (QString): 3 ownCloud/todoCalendarCalDAVPassword (QString): <hidden> ownCloud/todoCalendarCalDAVServerUrl (QString): empty ownCloud/todoCalendarCalDAVUsername (QString): empty ownCloud/todoCalendarCloudConnectionId (QString): 1 ownCloud/todoCalendarDisplayNameList: empty ownCloud/todoCalendarEnabledList: empty ownCloud/todoCalendarEnabledUrlList: empty ownCloud/todoCalendarUrlList: empty recentNoteFolders (QString): /home/laurenz/Nextcloud/Notes restoreCursorPosition (QString): true restoreLastNoteAtStartup (QString): true restoreNoteTabs (QString): true showMatches (QString): true showMenuBar (bool): true showStatusBar (bool): true showStatusBarNotePath (QString): true showStatusBarRelativeNotePath (QString): false spellCheckLanguage (QString): auto startInReadOnlyMode (QString): false systemIconTheme (QString): false taggingShowNotesRecursively (QString): false tagsPanelHideNoteCount (QString): false tagsPanelHideSearch (QString): false tagsPanelOrder (QString): 0 tagsPanelSort (QString): 0 todoCalendarSupport (QString): true toolbar/1/items (QStringList): action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionShow_local_trash, actionAllow_note_editing, , action_Back_in_note_history, action_Forward_in_note_history, , action_Find_text_in_note, actionReplace_in_current_note, , actionShow_versions, actionShow_trash, actionShare_note, , actionShow_Todo_List toolbar/1/name (QString): mainToolBar toolbar/1/title (QString): Hauptsymbolleiste toolbar/2/items (QStringList): actionFormat_text_bold, actionFormat_text_italic, actionStrike_out_text, actionInsert_code_block, actionInsert_block_quote toolbar/2/name (QString): formattingToolbar toolbar/2/title (QString): Formatierungs-Werkzeugleiste toolbar/3/items (QStringList): actionInsert_text_link, actionInsert_image, actionInsert_current_time toolbar/3/name (QString): insertingToolbar toolbar/3/title (QString): Einfügen-Werkzeugleiste toolbar/4/items (QStringList): action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note toolbar/4/name (QString): encryptionToolbar toolbar/4/title (QString): Verschlüsselung-Werkzeugleiste toolbar/5/items (QStringList): actionEnable_AI, actionAiBackendComboBox, actionAiModelComboBox toolbar/5/name (QString): aiToolbar toolbar/5/title (QString): AI toolbar toolbar/6/items (QStringList): actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size toolbar/6/name (QString): windowToolbar toolbar/6/title (QString): Fenster-Werkzeugleiste toolbar/7/items (QString): action_Quit toolbar/7/name (QString): quitToolbar toolbar/7/title (QString): Beenden - Symbolleiste toolbar/size (QString): 7 useNoteFolderButtons (QString): false useUNIXNewline (QString): false webAppClientService/serverUrl (QString): wss://app.qownnotes.org webAppClientService/token (QString): <hidden> webSocketServerService/bookmarksNoteName (QString): Bookmarks webSocketServerService/bookmarksTag (QString): bookmarks webSocketServerService/commandSnippetsNoteName (QString): Commands webSocketServerService/commandSnippetsTag (QString): commands webSocketServerService/port (QString): 22222 workspace-initial/name (QString): Minimal workspace-initial/noteSubFolderDockWidgetVisible (QString): true workspace-initial/windowState (QByteArray): <binary data> workspaces (QString): initial

System environment

HOME: /home/laurenz LANG: de_DE.UTF-8 LC_ADDRESS: de_DE.UTF-8 LC_IDENTIFICATION: de_DE.UTF-8 LC_MEASUREMENT: de_DE.UTF-8 LC_MONETARY: de_DE.UTF-8 LC_NAME: de_DE.UTF-8 LC_NUMERIC: de_DE.UTF-8 LC_PAPER: de_DE.UTF-8 LC_TELEPHONE: de_DE.UTF-8 LC_TIME: de_DE.UTF-8 LOGNAME: laurenz MAIL: /var/spool/mail/laurenz MANGOHUD: 1 PATH: /home/laurenz/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/rocm/bin:/var/lib/snapd/snap/bin QT_LOGGING_RULES: kwin_*.debug=true SHELL: /bin/bash USER: laurenz XDG_DATA_DIRS: /home/laurenz/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop XDG_RUNTIME_DIR: /run/user/1000 MOZ_ENABLE_WAYLAND: 1 SAL_FORCEDPI: 170 CASROOT: /usr CSF_DrawPluginDefaults: /usr/share/opencascade/resources/DrawResources CSF_EXCEPTION_PROMPT: 1 CSF_IGESDefaults: /usr/share/opencascade/resources/XSTEPResource CSF_LANGUAGE: us CSF_MDTVTexturesDirectory: /usr/share/opencascade/resources/Textures CSF_MIGRATION_TYPES: /usr/share/opencascade/resources/StdResource/MigrationSheet.txt CSF_OCCTResourcePath: /usr/share/opencascade/resources CSF_PluginDefaults: /usr/share/opencascade/resources/StdResource CSF_SHMessage: /usr/share/opencascade/resources/SHMessage CSF_STEPDefaults: /usr/share/opencascade/resources/XSTEPResource CSF_ShadersDirectory: /usr/share/opencascade/resources/Shaders CSF_StandardDefaults: /usr/share/opencascade/resources/StdResource CSF_StandardLiteDefaults: /usr/share/opencascade/resources/StdResource CSF_TObjDefaults: /usr/share/opencascade/resources/StdResource CSF_TObjMessage: /usr/share/opencascade/resources/TObj CSF_XCAFDefaults: /usr/share/opencascade/resources/StdResource CSF_XSMessage: /usr/share/opencascade/resources/XSMessage CSF_XmlOcafResource: /usr/share/opencascade/resources/XmlOcafResource DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus DEBUGINFOD_URLS: https://debuginfod.archlinux.org DESKTOP_SESSION: plasmawayland DISPLAY: :1 DRAWDEFAULT: /usr/share/opencascade/resources/DrawResources/DrawDefault DRAWHOME: /usr/share/opencascade/resources/DrawResources GTK2_RC_FILES: /etc/gtk-2.0/gtkrc:/home/laurenz/.gtkrc-2.0:/home/laurenz/.config/gtkrc-2.0 GTK_RC_FILES: /etc/gtk/gtkrc:/home/laurenz/.gtkrc:/home/laurenz/.config/gtkrc ICEAUTHORITY: /run/user/1000/iceauth_sfEczS KDE_APPLICATIONS_AS_SCOPE: 1 KDE_FULL_SESSION: true KDE_SESSION_UID: 1000 KDE_SESSION_VERSION: 6 MMGT_CLEAR: 1 MOTD_SHOWN: pam PAM_KWALLET5_LOGIN: /run/user/1000/kwallet5.socket PWD: /home/laurenz QT_AUTO_SCREEN_SCALE_FACTOR: 0 QT_LINUX_ACCESSIBILITY_ALWAYS_ON: 1 QT_WAYLAND_RECONNECT: 1 SESSION_MANAGER: local/laurenz-ManjaroKDE:@/tmp/.ICE-unix/1630,unix/laurenz-ManjaroKDE:/tmp/.ICE-unix/1630 SSH_AUTH_SOCK: /run/user/1000/gcr/ssh WAYLAND_DISPLAY: wayland-0 XAUTHORITY: /run/user/1000/xauth_rPBdbE XDG_CONFIG_DIRS: /home/laurenz/.config/kdedefaults:/etc/xdg:/usr/share/manjaro-kde-settings/xdg XDG_CURRENT_DESKTOP: KDE XDG_MENU_PREFIX: plasma- XDG_SEAT: seat0 XDG_SEAT_PATH: /org/freedesktop/DisplayManager/Seat0 XDG_SESSION_CLASS: user XDG_SESSION_DESKTOP: KDE XDG_SESSION_ID: 2 XDG_SESSION_PATH: /org/freedesktop/DisplayManager/Session1 XDG_SESSION_TYPE: wayland XDG_VTNR: 1 XKB_DEFAULT_LAYOUT: de MANAGERPID: 1018 INVOCATION_ID: b187ff952f484e40a5c44bc504c4f6bc JOURNAL_STREAM: 8:14868 SYSTEMD_EXEC_PID: 1687 MEMORY_PRESSURE_WATCH: /sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/session.slice/plasma-plasmashell.service/memory.pressure MEMORY_PRESSURE_WRITE: c29tZSAyMDAwMDAgMjAwMDAwMAA= LANGUAGE: empty XDG_ACTIVATION_TOKEN: kwin-30 XCURSOR_THEME: breeze_cursors XCURSOR_SIZE: 24

major-mayer avatar Aug 27 '24 11:08 major-mayer

The editor has no concept of what brackets the user means to be paired. It just searches for a matching open bracket, in this case a (.

pbek avatar Aug 27 '24 11:08 pbek

Hmm I see... Then it should maybe check if there is another closing bracket before the opening one and only delete when there isn't.

major-mayer avatar Aug 27 '24 12:08 major-mayer

What about multiple levels of the same brackets, then there could be closing brackets already. 🤷

pbek avatar Aug 27 '24 12:08 pbek

Ah damn. I think then something like a counter that tracks how many brackets are currently open and not closed by a following bracket would be necessary. But I see the complexity coming with this

major-mayer avatar Aug 27 '24 14:08 major-mayer

And then maybe some :-) mixed in between, have fun writing that system to account for all that... 😅

pbek avatar Aug 27 '24 17:08 pbek

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 27 '24 02:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 12 '24 02:10 github-actions[bot]