Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set file editor mode based on filename #276

Merged

Conversation

stoppert
Copy link
Contributor

@stoppert stoppert commented Oct 3, 2020

Replaces CodeMirror.findModeByExtension with CodeMirror.findModeByFileName to detect nginx conf files properly.

If findModeByFileName doesn't match anything it automatically tries to find a match via findModeByExtension. If that fails to return info as well we try to determine a mode by calling CodeMirror.findModeByMIME.

This is the discussion + pr in the codemirror repo
codemirror/codemirror5#2940
codemirror/codemirror5#3027

Fixes #187

@codecov
Copy link

codecov bot commented Oct 3, 2020

Codecov Report

Merging #276 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #276   +/-   ##
==========================================
  Coverage      94.26%   94.26%           
  Complexity       336      336           
==========================================
  Files             47       47           
  Lines            855      855           
==========================================
  Hits             806      806           
  Misses            49       49           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64fea43...6cd022e. Read the comment docs.

Copy link
Contributor

@ryanwinchester ryanwinchester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dshoreman dshoreman added this to In progress in File Manager via automation Oct 6, 2020
@dshoreman dshoreman self-assigned this Oct 6, 2020
@dshoreman dshoreman changed the title Replace CodeMirror.findModeByExtension with CodeMirror.findModeByFile… Set file editor mode based on filename Oct 12, 2020
…Name to detect nginx conf files properly

If findModeByExtension doesn't match anything it automatically tries to find a match via findModeByExtension
if that fails to return info as well we try to determine a mode by calling CodeMirror.findModeByMIME
@dshoreman dshoreman force-pushed the bug-codemirror-detect-nginx-conf-files branch from bc12cec to 6cd022e Compare October 12, 2020 19:36
@dshoreman dshoreman merged commit 37e18d4 into dshoreman:develop Oct 12, 2020
File Manager automation moved this from In progress to Done Oct 12, 2020
@stoppert stoppert deleted the bug-codemirror-detect-nginx-conf-files branch October 8, 2021 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
File Manager
  
Done
Development

Successfully merging this pull request may close these issues.

Nginx configs aren't detected by CodeMirror
3 participants