Skip to content

Commit

Permalink
Up to 1.0.0
Browse files Browse the repository at this point in the history
* New option: open-first-element
  • Loading branch information
little-brother committed Aug 16, 2022
1 parent 3f331d3 commit 64f04ce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#define MAX_LENGTH 4096
#define MAX_COLUMN_LENGTH 2000
#define APP_NAME TEXT("xmltab")
#define APP_VERSION TEXT("0.9.9")
#define APP_VERSION TEXT("1.0.0")
#define LOADING TEXT("Loading...")
#define WHITESPACE " \t\r\n"

Expand Down Expand Up @@ -511,6 +511,14 @@ HWND APIENTRY ListLoadW (HWND hListerWnd, TCHAR* fileToLoad, int showFlags) {
SendMessage(hMainWnd, WMU_SET_FONT, 0, 0);
SendMessage(hMainWnd, WMU_SET_THEME, 0, 0);
HTREEITEM hItem = TreeView_GetNextItem(hTreeWnd, TVI_ROOT, TVGN_CHILD);
if (getStoredValue(TEXT("open-first-element"), 1)) {
xml_element* node = (xml_element*)TreeView_GetItemParam(hTreeWnd, hItem);
while(node && (!node->key || node->key[0] == '?' || node->key[0] == '!'))
node = node->next;

if (node)
hItem = (HTREEITEM)node->userdata;
}
TreeView_Select(hTreeWnd, hItem, TVGN_CARET);
ShowWindow(hMainWnd, SW_SHOW);
SetFocus(hTreeWnd);
Expand Down

0 comments on commit 64f04ce

Please sign in to comment.