Photo

The delegate math remains tough, but for Senator Bernie Sanders of Vermont, the revolution lives on for another day.

Mr. Sanders won the West Virginia primary on Tuesday night, a decisive win over Hillary Clinton in a state where the coal mining industry has been hampered by President Obama’s environmental policies. Donald J. Trump also won in the state, as well as in Nebraska, although his two remaining rivals left the race last week.

Mrs. Clinton won West Virginia over Mr. Obama in 2008. And Mr. Obama received a primary challenge there in 2012 from a Texas felon who won some counties there. The politics of the state have been hard to cleave away from racial lines.

But Mrs. Clinton struggled in the state, not just because of her alliance with Mr. Obama, but also because of her missteps in discussing the coal industry. A comment, lifted out of context but clunky nonetheless, about the coal industry and people being put out of business followed her there, and she faced protests from coal workers during campaign stops.

Primaries are not necessarily bellwethers for how candidates will fare in a general election. But Mrs. Clinton will have work to do with white working-class voters in the fall in battlegrounds like Pennsylvania.

And so Mr. Sanders’s candidacy continues, a fact that has exasperated some of Mrs. Clinton’s supporters, particularly as Mr. Trump has sewn up his race weeks before people expected him to. But if there is a silver lining for Mrs. Clinton, it is that Mr. Sanders’s lingering presence gives her cover to settle on an effective course against Mr. Trump, something her team does not yet seem to have done.