Re: [code] Something about textadept

From: Alexander Misel <alexander_misel.att.live.cn>
Date: Wed, 27 Mar 2019 03:10:54 +0000

Actually, the reason why I didn't use io.close_buffer is that the function has confirmation, and before every closing I have to go to that buffer, which is an effect that I don't want to see.
________________________________
From: Mitchell <m.att.foicica.com>
Sent: Wednesday, March 27, 2019 10:27
To: code.att.foicica.com
Subject: Re: [code] Something about textadept

Hi Alexander,

On Tue, 26 Mar 2019, Alexander Misel wrote:

> * We can support *.yml and *.vue by simply adding them to known file types
>
> { vue='html', yml='yaml' }

Thanks. I'll add these.

> * Searching: when matched word is in a long, wrapped line, then the vertical scrollbar should also move to that position; currently, it does not.

I'll try to reproduce this and look into a fix.

> * The usage for ui.dialogs.optionselect<https://foicica.com/textadept/api.html#ui.dialogs.optionselect> missed a comma before items

Thanks.

> * A simple implementation of Close Others function (ignoring modified files), which will help a lot when you don't want to close a buffer when you opened too many buffers
>
> function io.close_other_buffers()
> local cur_buf_index = _BUFFERS[buffer]
> for i, v in ipairs(_BUFFERS) do
> if i ~= cur_buf_index and not v.modify then
> v:delete()
> end
> end
> end
> ...
> local default_tab_context_menu = {
> {_L['_Close'], io.close_buffer},
> {_L['Close Others'], io.close_other_buffers},
> SEPARATOR,
> ...
> }

Other than the use of `buffer:delete()`, which should be replaced with `io.close_buffer()` per the documentation, feel free to add to the wiki :)

> * I modified CSS lexer a bit to support my often used CSS3 properties. See attach file.

Thanks. I'll add the extra keywords.

> * In HTML lexer, we don't have to bother checking the type whether it is 'text/css' I thnk. This would help on <style scoped> or <style lang="less"> etc.
>
> local css_start_rule = #(P('<') * style_element) * lex.embed_start_tag

If Textadept ever got a dedicated 'less' lexer, then this would not work according to the example you gave. Since <script> tags can have different options, I feel like <style> should too. If there's been a recent addition to the HTML standard that allows for more <style> options that is not handled by Textadept's lexer, please let me know and I'll fix it.

Cheers,
Mitchell

--
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 26 Mar 2019 - 23:10:54 EDT

This archive was generated by hypermail 2.2.0 : Wed 27 Mar 2019 - 06:33:12 EDT