mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-11 17:17:42 +03:00
Fixed "ft" in locate bar.
Fixed a bug in the tokenizer when switching stacked sub-syntaxes. Fixed export languages.
This commit is contained in:
@@ -251,6 +251,7 @@ static inline void popStack( SyntaxStateRestored& curState, SyntaxState& retStat
|
||||
|
||||
if ( retState.langStack[curState.currentLevel] != 0 &&
|
||||
retState.langStack[curState.currentLevel] != syntax.getLanguageIndex() ) {
|
||||
retState.langStack[curState.currentLevel] = 0;
|
||||
setSubsyntaxPatternIdx( curState, retState, SyntaxStateType{} );
|
||||
|
||||
// Remove all the removed language stack
|
||||
|
||||
@@ -8,7 +8,7 @@ SyntaxDefinition& addTypst() {
|
||||
return SyntaxDefinitionManager::instance()
|
||||
->add(
|
||||
|
||||
{ "typst",
|
||||
{ "Typst",
|
||||
{ "%.typ$" },
|
||||
{
|
||||
{ { "include", "#markup" },
|
||||
|
||||
@@ -414,6 +414,9 @@ void LanguagesSyntaxHighlighting::load() {
|
||||
{ "%.lisp$", "%.cl$", "%.el$" },
|
||||
} );
|
||||
|
||||
sdm->addPreDefinition(
|
||||
{ "L.B. Stanza", []() -> SyntaxDefinition& { return addLbstanza(); }, { "%.stanza$" } } );
|
||||
|
||||
sdm->addPreDefinition( {
|
||||
"Lobster",
|
||||
[]() -> SyntaxDefinition& { return addLobster(); },
|
||||
@@ -626,7 +629,7 @@ void LanguagesSyntaxHighlighting::load() {
|
||||
{ "ts" } } );
|
||||
|
||||
sdm->addPreDefinition(
|
||||
{ "typst", []() -> SyntaxDefinition& { return addTypst(); }, { "%.typ$" } } );
|
||||
{ "Typst", []() -> SyntaxDefinition& { return addTypst(); }, { "%.typ$" } } );
|
||||
|
||||
sdm->addPreDefinition( {
|
||||
"Ü",
|
||||
|
||||
@@ -4112,6 +4112,9 @@ static void exportLanguages( const std::string& path, const std::string& langs,
|
||||
SyntaxDefinitionManager::instance()->loadFromFolder( langsPath );
|
||||
std::vector<SyntaxDefinition> defs;
|
||||
|
||||
for ( auto& preDef : sdm->getPreDefinitions() )
|
||||
preDef.load();
|
||||
|
||||
if ( !langs.empty() ) {
|
||||
if ( langs == "all" ) {
|
||||
defs = sdm->getDefinitions();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "universallocator.hpp"
|
||||
#include "ecode.hpp"
|
||||
#include "pathhelper.hpp"
|
||||
#include "settingsmenu.hpp"
|
||||
#include "universallocator.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -932,18 +932,24 @@ std::shared_ptr<ItemListOwnerModel<std::string>>
|
||||
UniversalLocator::openFileTypeModel( const std::string& pattern ) {
|
||||
if ( nullptr == mApp->getSplitter()->getCurEditor() )
|
||||
return ItemListOwnerModel<std::string>::create( {} );
|
||||
const auto& preDefs = SyntaxDefinitionManager::instance()->getPreDefinitions();
|
||||
const auto& defs = SyntaxDefinitionManager::instance()->getDefinitions();
|
||||
std::vector<std::string> fileTypeNames;
|
||||
fileTypeNames.reserve( defs.size() );
|
||||
std::set<std::string> fileTypeNames;
|
||||
for ( const auto& def : preDefs ) {
|
||||
if ( pattern.empty() || String::startsWith( String::toLower( def.getLanguageName() ),
|
||||
String::toLower( pattern ) ) )
|
||||
fileTypeNames.insert( def.getLanguageName() );
|
||||
}
|
||||
for ( const auto& def : defs ) {
|
||||
if ( !def.isVisible() )
|
||||
continue;
|
||||
if ( pattern.empty() || String::startsWith( String::toLower( def.getLanguageName() ),
|
||||
String::toLower( pattern ) ) )
|
||||
fileTypeNames.push_back( def.getLanguageName() );
|
||||
fileTypeNames.insert( def.getLanguageName() );
|
||||
}
|
||||
std::sort( fileTypeNames.begin(), fileTypeNames.end() );
|
||||
return ItemListOwnerModel<std::string>::create( fileTypeNames );
|
||||
return ItemListOwnerModel<std::string>::create(
|
||||
std::vector<std::string>( std::make_move_iterator( fileTypeNames.begin() ),
|
||||
std::make_move_iterator( fileTypeNames.end() ) ) );
|
||||
}
|
||||
|
||||
void UniversalLocator::updateSwitchFileTypeTable() {
|
||||
|
||||
Reference in New Issue
Block a user