Skip to content

Commit

Permalink
Fix forgotten parse2 calls in VimAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
grwlf committed Feb 27, 2016
1 parent de63d48 commit 7527a89
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
build
.*
19 changes: 1 addition & 18 deletions XKbSwitchApi.cpp
Expand Up @@ -72,24 +72,7 @@ namespace
return symNames;
}

loaded = true;
XkbGetControls( xkb->_display, XkbAllControlsMask, xkb->_kbdDescPtr );
XkbGetNames( xkb->_display, XkbSymbolsNameMask, xkb->_kbdDescPtr );

Atom symNameAtom = xkb->_kbdDescPtr->names->symbols;
if ( symNameAtom == None )
return symNames;

char * symNameC = XGetAtomName( xkb->_display, symNameAtom );
string symName( symNameC );

XFree( symNameC );

if ( symName.empty() )
return symNames;

symNames = parse2( symName, nonsyms() );

xkb->BuildLayout(symNames);
return symNames;
}
}
Expand Down
22 changes: 0 additions & 22 deletions XKeyboard.h
Expand Up @@ -62,28 +62,6 @@ class XKeyboard

};

// Parses keyboard string returned by get_kb_stirng. ns are symbols to ignore,
// normally the result of nonsyms()
string_vector parse1(const std::string& symbols, const string_vector& ns);
string_vector parse2(const std::string& symbols, const string_vector& ns);
string_vector parse3(const std::string& symbols, const string_vector& ns);

// Symbols to be ignored by the parser
inline string_vector nonsyms()
{
string_vector nonsyms;
nonsyms.push_back("group");
nonsyms.push_back("inet");
nonsyms.push_back("ctr");
nonsyms.push_back("pc");
nonsyms.push_back("ctrl");
nonsyms.push_back("capslock");
nonsyms.push_back("compose");
nonsyms.push_back("terminate");
nonsyms.push_back("eurosign");
return nonsyms;
}

}

#endif
Expand Down

0 comments on commit 7527a89

Please sign in to comment.